見 https://stackoverflow.com/questions/47244834/how-to-join-a-list-of-strings-in-ansible
使用函數
# 使用 '\n' 將 my_list 中的元素連接爲字符串
- name: Concatenate the public keys
set_fact:
my_joined_list: "{{ my_list | join('\n') }}"
見 https://stackoverflow.com/questions/47244834/how-to-join-a-list-of-strings-in-ansible
使用函數
# 使用 '\n' 將 my_list 中的元素連接爲字符串
- name: Concatenate the public keys
set_fact:
my_joined_list: "{{ my_list | join('\n') }}"
- hosts: all tasks: - shell: ls -lrht /opt/appd | grep bak register: appd_contents - debug: var:
--- - hosts: all gather_facts: no become: yes become_user: root tasks: - name: tar_file s
一、備份 思路: ①集羣運行中etcd數據備份到磁盤上 ②kubeasz項目創建的集羣,需要備份CA證書文件,以及ansible的hosts文件 【deploy節點操