Saya menggunakan ini: 1. Tarik direktori dari host jarak jauh ke host tertentu
- name: Gather hosts stats from other hosts
shell: " scp -r {{results_root_dir_src}} root@{{groups['profiling_server'][0]}}:{{results_root_dir_dest}}/abc/"
when: "'profiling_server' not in group_names"
#It will not run on the node where the directories need to be copied.
- Tarik direktori dari node ke localhost
- name: Gather from host to local
delegate_to: 127.0.0.1
run_once: true
become: false
shell: "scp -r root@{{groups['profiling_server'][0]}}:{{results_root_dir}} ./results_local_location "
inventaris
[nodes]
server1
server2
server3
[profiling_server]
server1