diff --git a/Copy_Files.yml b/Copy_Files.yml index 8a84f13..3287890 100644 --- a/Copy_Files.yml +++ b/Copy_Files.yml @@ -13,7 +13,15 @@ - name: Copier le fichier via SCP 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