diff --git a/geant/gap_ansible/plugins/netconf/sros.py b/geant/gap_ansible/plugins/netconf/sros.py index 6c4f39289e3f3a975169374aad60540fec560ae6..86076cf0820d6c4fa33c6611b35245a404c8d9a8 100644 --- a/geant/gap_ansible/plugins/netconf/sros.py +++ b/geant/gap_ansible/plugins/netconf/sros.py @@ -102,3 +102,8 @@ class Netconf(NetconfBase): """ resp = self.m.commit(confirmed=confirmed, timeout=timeout, persist=persist, comment=comment) return resp.data_xml if hasattr(resp, "data_xml") else resp.xml + + def set_config_mode(self, config_mode): + """Set the config_mode passed from the module.""" + if config_mode: + self._config_mode = config_mode 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 8803e4451c0f19c499b00c860b5742affa574d70..c29a2a046af6678c16730bacd02dd4fd7ed4c617 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 @@ -36,6 +36,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ wfo_router.router.vendor }}/base_config.j2') }}" commit: true validate: true + config_mode: private diff: true register: output check_mode: true @@ -75,6 +76,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ wfo_router.router.vendor }}/base_config.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false when: > diff --git a/geant/gap_ansible/roles/ibgp_update/tasks/deploy.yaml b/geant/gap_ansible/roles/ibgp_update/tasks/deploy.yaml index 26e38d191d059afd16e7b03f5268698d7df3383a..5d60a579b71ccf9486564458910bd1fab9d46470 100644 --- a/geant/gap_ansible/roles/ibgp_update/tasks/deploy.yaml +++ b/geant/gap_ansible/roles/ibgp_update/tasks/deploy.yaml @@ -29,6 +29,7 @@ content: "{{ lookup('ansible.builtin.template', '{{ vendor }}/{{ verb }}.j2') }}" commit: true validate: true + config_mode: private diff: true register: output check_mode: true @@ -53,6 +54,7 @@ content: "{{ lookup('ansible.builtin.template', '{{ vendor }}/{{ verb }}.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false when: > diff --git a/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml b/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml index 44856221e4e5ae981280af7f6dffe753b7b3b241..acbaade50ce347b6ccd125a15cd06806d601a3e5 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml @@ -41,6 +41,7 @@ default_operation: merge content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true + config_mode: private diff: true register: output check_mode: true @@ -67,6 +68,7 @@ content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false when: > diff --git a/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml b/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml index 590a534bca4cd7954aae8f4e45c25f629d667faa..271c8efe7707494557653099930c5ed9d1562951 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml @@ -24,11 +24,13 @@ local_side.iptrunk_side_node.vendor == "juniper" - name: Remove "{{ config_object }}" on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA] - ansible.netcommon.netconf_config: + # ansible.netcommon.netconf_config: + geant.gap_ansible.nokia_netconf_config: format: xml default_operation: merge content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true + config_mode: private diff: true check_mode: true when: > @@ -37,11 +39,14 @@ local_side.iptrunk_side_node.vendor == "nokia" - name: Remove base_config on "{{ inventory_hostname }}" [AND COMMIT][NOKIA] - ansible.netcommon.netconf_config: + # ansible.netcommon.netconf_config: + geant.gap_ansible.nokia_netconf_config: format: xml default_operation: merge content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true + commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false when: > diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/deactivate_trunk_side.yaml b/geant/gap_ansible/roles/iptrunk_migration/tasks/deactivate_trunk_side.yaml index a368daf9c2d5c3a76a9a7122185ba9b88248f419..2eb8ec6c0ec7a0003e805302fdb4ee1a2496de21 100644 --- a/geant/gap_ansible/roles/iptrunk_migration/tasks/deactivate_trunk_side.yaml +++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/deactivate_trunk_side.yaml @@ -39,6 +39,7 @@ default_operation: merge content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true + config_mode: private diff: true check_mode: true @@ -55,5 +56,6 @@ content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/deploy_object.yaml b/geant/gap_ansible/roles/iptrunk_migration/tasks/deploy_object.yaml index ca9d00854365ee70a78a5b73a1f5249469143a67..e9fd16833566c902c6398e0bfeb130fe9df77dd3 100644 --- a/geant/gap_ansible/roles/iptrunk_migration/tasks/deploy_object.yaml +++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/deploy_object.yaml @@ -29,6 +29,7 @@ default_operation: merge content: "{{ lookup('ansible.builtin.template', '{{ new_node.router.vendor }}/{{ config_object }}.j2') }}" commit: true + config_mode: private diff: true check_mode: true when: > @@ -43,6 +44,7 @@ content: "{{ lookup('ansible.builtin.template', '{{ new_node.router.vendor }}/{{ config_object }}.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false when: > diff --git a/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml b/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml index 72336382bf44dc2a774bb99ea670f0e6f6677f1c..b67902ad4315576cbb4cf4b0354161175b349f30 100644 --- a/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml +++ b/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml @@ -41,6 +41,7 @@ default_operation: merge content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true + config_mode: private diff: true register: output check_mode: true @@ -67,6 +68,7 @@ content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false when: > diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy.yaml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy.yaml index 1533f1345a1369af906e3380d9cfa7caf811186d..8d7019f0c4396e969340743ae8a0bb566361d3be 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy.yaml +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy.yaml @@ -8,6 +8,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_config.j2') }}" commit: true validate: true + config_mode: private diff: true register: output check_mode: true @@ -22,6 +23,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_vprn.j2') }}" commit: true validate: true + config_mode: private diff: true register: output check_mode: true @@ -36,6 +38,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_update_sdp.j2') }}" commit: true validate: true + config_mode: private diff: true register: output check_mode: true @@ -50,6 +53,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/router/delete_default_static_routes.j2') }}" commit: true validate: true + config_mode: private diff: true register: output check_mode: true @@ -72,6 +76,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_config.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false @@ -85,6 +90,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_vprn.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false @@ -98,6 +104,7 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_update_sdp.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false @@ -111,5 +118,6 @@ content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/router/delete_default_static_routes.j2') }}" commit: true commit_comment: "{{ commit_comment }}" + config_mode: private diff: true check_mode: false