From 3340a1bc5be0f10de1e85c8d4b2b0521f7af939d Mon Sep 17 00:00:00 2001 From: JocelynPa Date: Fri, 10 Mar 2023 15:23:13 +0100 Subject: [PATCH] update copy file --- Copy_Files.yml | 58 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/Copy_Files.yml b/Copy_Files.yml index 61cdca6..9e609e7 100644 --- a/Copy_Files.yml +++ b/Copy_Files.yml @@ -1,3 +1,21 @@ +--- +- name: Copier un fichier via SCP + hosts: all:!splunk_uf_Linux_TIC + become: false + 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 @@ -12,23 +30,23 @@ #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" +# - 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"