diff --git a/geant/gap_ansible/roles/base_config_checks/tasks/main.yml b/geant/gap_ansible/roles/base_config_checks/tasks/main.yml index 2dc23352e83653503b981d5c5f4dc4348249c124..8091c2d2f5490f659079e6342bf04b28d6be37ad 100644 --- a/geant/gap_ansible/roles/base_config_checks/tasks/main.yml +++ b/geant/gap_ansible/roles/base_config_checks/tasks/main.yml @@ -6,19 +6,14 @@ when: ( wfo_router.router.router_access_via_ts | ansible.builtin.bool ) is true -- name: Set variable to connect to nokia - ansible.legacy.set_fact: - ansible_network_os: nokia.sros.md - ansible_connection: netconf - when: - wfo_router.router.vendor == "nokia" +- name: Import variables from 'all' + ansible.builtin.include_vars: + dir: /opt/ansible_inventory/group_vars/all -- name: Set variables for connecting to Junos - ansible.legacy.set_fact: - ansible_network_os: junos - ansible_connection: netconf - when: - wfo_router.router.vendor == "juniper" +- name: Set variable to connect to nokia + ansible.builtin.set_fact: + ansible_connection: "{{ netconf_access[wfo_router.router.vendor].ansible_connection }}" + ansible_network_os: "{{ netconf_access[wfo_router.router.vendor].ansible_network_os }}" - name: Execute post-check command [NOKIA] when: