Eu uso o seguinte: 1. Puxe diretórios do host remoto para hosts específicos
- 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.
- Puxar diretórios do nó para o host local
- 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 "
inventário
[nodes]
server1
server2
server3
[profiling_server]
server1