From 18906856e0b1769ffd41a7fa0fea5bf2b050570a Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <aleksandr.kurbatov@GL1342-AKURBATOV.local>
Date: Tue, 13 Aug 2024 17:39:16 +0100
Subject: [PATCH] iptrunk_checks - optical diff

only produce diff when called from `iptrun_migration`, and `new_node` is
therefore defined.
the diff will be skipped if the role called from elsewhere.
---
 geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml b/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml
index af907bd0..a27e3862 100644
--- a/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml
+++ b/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml
@@ -152,5 +152,7 @@
   when: >-
     check == "optical_post"
     and
+    new_node is defined
+    and
     inventory_hostname != new_node.router.router_fqdn
   ansible.builtin.include_tasks: diff_optical_results.yaml
-- 
GitLab