master
JocelynPa 3 years ago
parent 52a6988657
commit 02c2155ee8

@ -13,7 +13,15 @@
- name: Copier le fichier via SCP - name: Copier le fichier via SCP
command: scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null {{ remote_user }}@{{ remote_host }}:{{ source_file }} {{ destination_file }} command: scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null {{ remote_user }}@{{ remote_host }}:{{ source_file }} {{ destination_file }}
- name: Vérifier si le fichier a été copié
stat:
path: "{{ destination_file }}"
register: file_stat
- name: Afficher un message d'erreur si le fichier n'a pas été copié
fail:
msg: "La copie SCP a échoué"
when: not file_stat.stat.exists

Loading…
Cancel
Save