From 2f86989f2704a09bad50770fb6e3d64aa75da08e Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <aleksandr.kurbatov@GL1342.local>
Date: Wed, 22 May 2024 17:59:39 +0100
Subject: [PATCH] Correct failure if any change is detected

---
 .../roles/base_config/tasks/deploy_base_config.yaml  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml b/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml
index 1a0b6dc0..cbd919bf 100644
--- a/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml
+++ b/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml
@@ -11,11 +11,6 @@
     ( dry_run | ansible.builtin.bool ) is true and
     wfo_router.router.vendor == "juniper"
 
-- name: Fail if there is any diff 
-  ansible.builtin.fail:
-    msg: There are diffs!!!! 
-  when: output.diff != "" and is_verification_workfloy == true
-
 
 - name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][Juniper]
   junipernetworks.junos.junos_config:
@@ -47,8 +42,11 @@
 
 - name: Fail if there is any diff 
   ansible.builtin.fail:
-    msg: There are diffs!!!! 
-  when: output.diff != "" and is_verification_workfloy == true
+    msg: There are diffs!!!!
+  when: >
+    output.changed | ansible.builtin.bool
+    and
+    is_verification_workflow | ansible.builtin.bool
 
 
 - name: Validation succeeded
-- 
GitLab