From 598a7c158125cde0c0ac4334dac636b7ede0c003 Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <aleksandr.kurbatov@GL1342.local>
Date: Thu, 14 Mar 2024 16:41:00 +0000
Subject: [PATCH] iptrunks_migration: netconf_access

Correctly set `ansible_connection` and `ansible_network_os` for Nokia when deploying and the target is not connected via TS.
---
 geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml b/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml
index 67c71a7c..9474d27a 100644
--- a/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml
+++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml
@@ -45,10 +45,16 @@
   ansible.builtin.set_fact:
     ansible_host: "{{ new_node.router.router_site.site_ts_address }}"
     ansible_port: "{{ new_node.router.router_ts_port }}"
+  when:
+    verb == "deploy" and ( new_node.router.router_access_via_ts | ansible.builtin.bool ) is true
+
+# TODO: set ansible_connection / ansible_network_os when not TS
+- name: Set connection and host OS
+  ansible.builtin.set_fact:
     ansible_connection: "{{ netconf_access[new_node.router.vendor].ansible_connection }}"
     ansible_network_os: "{{ netconf_access[new_node.router.vendor].ansible_network_os }}"
   when:
-    verb == "deploy" and ( new_node.router.router_access_via_ts | ansible.builtin.bool ) is true
+    verb == "deploy"
 
 - name: Print the ID
   ansible.builtin.debug:
-- 
GitLab