From 02c2155ee899878e20088dea4fd41a2699858c48 Mon Sep 17 00:00:00 2001 From: JocelynPa Date: Fri, 10 Mar 2023 15:40:04 +0100 Subject: [PATCH] update V6 --- Copy_Files.yml | 8 ++++++++ 1 file changed, 8 insertions(+) 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