diff --git a/geant/gap_ansible/roles/ibgp_update/tasks/main.yml b/geant/gap_ansible/roles/ibgp_update/tasks/main.yml index 3fe519471853b89bc8fc816fc4d59809d9272695..eb64cdb2e133602bde6523b48452f32b9b89c2c4 100644 --- a/geant/gap_ansible/roles/ibgp_update/tasks/main.yml +++ b/geant/gap_ansible/roles/ibgp_update/tasks/main.yml @@ -27,6 +27,11 @@ ansible.builtin.include_tasks: add_p_to_pe.yaml when: verb == "add_p_to_pe" +- name: Include PE mesh modification tasks + ansible.builtin.include_tasks: modify_pe_mesh.yaml + when: > + verb in [ "add_p_to_pe", "remove_pe_from_net", "remove_p_from_pe" ] + - name: Include PE into P tasks if selected ansible.builtin.include_tasks: add_pe_to_p.yaml when: > diff --git a/geant/gap_ansible/roles/ibgp_update/tasks/add_p_to_pe.yaml b/geant/gap_ansible/roles/ibgp_update/tasks/modify_pe_mesh.yaml similarity index 92% rename from geant/gap_ansible/roles/ibgp_update/tasks/add_p_to_pe.yaml rename to geant/gap_ansible/roles/ibgp_update/tasks/modify_pe_mesh.yaml index b63274a376b4bdaaf63c445c263b00d66830cdee..7b8bcaffd64e7d356a817a33d016616d1237c6ad 100644 --- a/geant/gap_ansible/roles/ibgp_update/tasks/add_p_to_pe.yaml +++ b/geant/gap_ansible/roles/ibgp_update/tasks/modify_pe_mesh.yaml @@ -7,7 +7,7 @@ # - name: Set variable to connect to nokia ansible.legacy.set_fact: - ansible_network_os: nokia.sros.md + ansible_network_os: geant.gap_ansible.sros ansible_connection: netconf when: vendor == "nokia" diff --git a/geant/gap_ansible/roles/ibgp_update/templates/juniper/remove_p_from_pe.j2 b/geant/gap_ansible/roles/ibgp_update/templates/juniper/remove_p_from_pe.j2 new file mode 100644 index 0000000000000000000000000000000000000000..0a139d34d9206da6cb197936779ec4f17775cdd0 --- /dev/null +++ b/geant/gap_ansible/roles/ibgp_update/templates/juniper/remove_p_from_pe.j2 @@ -0,0 +1,2 @@ +delete protocols bgp group iGEANT6-P-ONLY neighbor {{ p_lo_ipv6_address }} +delete protocols bgp group iGEANT-P-ONLY neighbor {{ p_lo_ipv4_address }} diff --git a/geant/gap_ansible/roles/ibgp_update/templates/juniper/remove_pe_from_net.j2 b/geant/gap_ansible/roles/ibgp_update/templates/juniper/remove_pe_from_net.j2 new file mode 100644 index 0000000000000000000000000000000000000000..9bd780dd826aa532f672683543211a61c869787e --- /dev/null +++ b/geant/gap_ansible/roles/ibgp_update/templates/juniper/remove_pe_from_net.j2 @@ -0,0 +1,2 @@ +delete protocols bgp group iGEANT6 neighbor {{ subscription.router.router_lo_ipv6_address }} +delete protocols bgp group iGEANT neighbor {{ subscription.router.router_lo_ipv4_address }} diff --git a/geant/gap_ansible/roles/ibgp_update/templates/nokia/remove_pe_from_net.j2 b/geant/gap_ansible/roles/ibgp_update/templates/nokia/remove_pe_from_net.j2 new file mode 100644 index 0000000000000000000000000000000000000000..3fddd5f66425553c04457e292a73a6f4f05d2d78 --- /dev/null +++ b/geant/gap_ansible/roles/ibgp_update/templates/nokia/remove_pe_from_net.j2 @@ -0,0 +1,17 @@ +<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0"> + <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"> + <router> + <router-name>Base</router-name> + <bgp> + <neighbor xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <ip-address>{{ subscription.router.router_lo_ipv4_address }}</ip-address> + <group>iGEANT</group> + </neighbor> + <neighbor xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <ip-address>{{ subscription.router.router_lo_ipv6_address }}</ip-address> + <group>iGEANT6</group> + </neighbor> + </bgp> + </router> + </configure> +</config> diff --git a/geant/gap_ansible/roles/ibgp_update/templates/nokia/remove_pe_from_p.j2 b/geant/gap_ansible/roles/ibgp_update/templates/nokia/remove_pe_from_p.j2 new file mode 100644 index 0000000000000000000000000000000000000000..088de3ea3e583585c12d56d90ab5b36bbd25f7ad --- /dev/null +++ b/geant/gap_ansible/roles/ibgp_update/templates/nokia/remove_pe_from_p.j2 @@ -0,0 +1,17 @@ +<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0"> + <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"> + <router> + <router-name>Base</router-name> + <bgp> + <neighbor xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <ip-address>{{ subscription.router.router_lo_ipv4_address }}</ip-address> + <group>iGEANT-P-ONLY</group> + </neighbor> + <neighbor xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <ip-address>{{ subscription.router.router_lo_ipv6_address }}</ip-address> + <group>iGEANT6-P-ONLY</group> + </neighbor> + </bgp> + </router> + </configure> +</config> diff --git a/geant/gap_ansible/roles/ibgp_update/vars/main.yml b/geant/gap_ansible/roles/ibgp_update/vars/main.yml index e118a3ef5d659ab367562d790c51cb4e3d68c389..caaa12313e9f3c673a9235377f08ba497fe2d30a 100644 --- a/geant/gap_ansible/roles/ibgp_update/vars/main.yml +++ b/geant/gap_ansible/roles/ibgp_update/vars/main.yml @@ -8,9 +8,10 @@ verbs: - check_p_ibgp - verify_p_ibgp # Validates the config of BGP stanza including neighbors - remove_p_from_pe # placeholder for future use | Removes the P that is going to be promoted to PE from the P-GROUP on all PEs + - remove_pe_from_p # PE router termination workflow + - remove_pe_from_net # When decommissiong a PE we remove it from PE-GROUP and P-GROUP on all the PE and P routers - add_pe_to_pe # placeholder for future use | Adds the newly installed PE (could be an EX-P or a new PE) to the PE-GROUP on all the other PEs - add_new_pe_to_p # placeholder for future use | Adds the newly installed PE (could be an EX-P or a new PE) the P-GROUP on all the Ps - - remove_pe_from_net # placeholder for future use | When decommissiong a PE we remove it from PE-GROUP and P-GROUP on all the PE and P routers - promote_p_to_pe # placeholder for future use | Deletes P-GROUP and adds wfo_router: "{{ subscription }}" p_lo_ipv4_address: "{{ wfo_router.router.router_lo_ipv4_address }}"