--- - name: Copier un fichier via SCP hosts: all:!splunk_uf_Linux_TIC become: true become_user: root vars: source_file: "/tmp/splunk-8.2.3-cd0848707637-Linux-x86_64.tgz" destination_file: "/tmp/splunk-8.2.3-cd0848707637-Linux-x86_64.tgz" remote_host: "10.10.30.38" remote_user: "admin" remote_password: "921223Jocpam!?" tasks: - name: Copier le fichier via SCP command: scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null {{ remote_user }}@{{ remote_host }}:{{ source_file }} {{ destination_file }} #- name: Copier depuis repo #hosts: SVLCTPSUPPFI02.mom.fr #become: true #tasks: #- name: copy #copy: #src: /tmp/splunkforwarder-8.2.3-cd0848707637-Linux-x86_64.tgz #dest: /home/admin/splunkforwarder.tgz #remote_src: true #owner: admin #group: admin #mode: "0644" #delegate_to: 10.10.30.38 # - name: Récupérer le fichier depuis l'hôte source et le copier sur l'hôte distant # hosts: SVLCTPSUPPFI02.mom.fr # become: true # tasks: # - name: Récupérer le fichier depuis l'hôte source # fetch: # src: /tmp/splunkforwarder-8.2.3-cd0848707637-Linux-x86_64.tgz # dest: /tmp/ # flat: yes # validate_checksum: yes # fail_on_missing: yes # fail_on_unreachable: yes # delegate_to: 10.10.30.38 # - name: Copier le fichier vers l'hôte distant # copy: # src: /tmp/splunkforwarder-8.2.3-cd0848707637-Linux-x86_64.tgz # dest: "{{ splunk_build_location_uf }}" # owner: admin # group: admin # mode: "0644"