Skip to content
Snippets Groups Projects
Commit 4f11b237 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Merge branch 'feature/nat-667-terminate-router-ibgp' into 'develop'

ibgp_update modifications

See merge request !157
parents 656f1c6d 1fbc0c55
No related branches found
No related tags found
1 merge request!157ibgp_update modifications
Pipeline #88050 passed
Showing with 96 additions and 5 deletions
...@@ -23,15 +23,21 @@ ...@@ -23,15 +23,21 @@
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ opid }}" msg: "{{ opid }}"
- name: Include P into PEs tasks if selected - name: Include PE mesh modification tasks
ansible.builtin.include_tasks: add_p_to_pe.yaml ansible.builtin.include_tasks: modify_pe_mesh.yaml
when: verb == "add_p_to_pe" when: >
verb in [ "add_p_to_pe", "remove_pe_from_pe", "remove_p_from_pe" ]
- name: Include PE into P tasks if selected - name: Include PE into P tasks if selected
ansible.builtin.include_tasks: add_pe_to_p.yaml ansible.builtin.include_tasks: add_pe_to_p.yaml
when: > when: >
verb in [ "add_pe_to_p", "verify_p_ibgp" ] verb in [ "add_pe_to_p", "verify_p_ibgp" ]
- name: Include PE removal from P tasks if selected
ansible.builtin.include_tasks: remove_pe_from_p.yaml
when: >
verb in [ "remove_pe_from_p" ]
- name: Check status of iBGP on P router - name: Check status of iBGP on P router
ansible.builtin.include_tasks: check_p_ibgp.yaml ansible.builtin.include_tasks: check_p_ibgp.yaml
when: verb == "check_p_ibgp" when: verb == "check_p_ibgp"
...@@ -4,18 +4,17 @@ ...@@ -4,18 +4,17 @@
- name: Adjust network connection according to the vendor - name: Adjust network connection according to the vendor
block: block:
# - name: Set variable to connect to nokia
- name: Set variable to connect to nokia ansible.legacy.set_fact:
ansible.legacy.set_fact: ansible_network_os: geant.gap_ansible.sros
ansible_network_os: nokia.sros.md ansible_connection: netconf
ansible_connection: netconf when: vendor == "nokia"
when: vendor == "nokia"
- name: Set variables for connecting to Junos - name: Set variables for connecting to Junos
ansible.legacy.set_fact: ansible.legacy.set_fact:
ansible_network_os: junos ansible_network_os: junos
ansible_connection: netconf ansible_connection: netconf
when: vendor == "juniper" when: vendor == "juniper"
- name: Include compile tasks - name: Include compile tasks
ansible.builtin.include_tasks: compile.yaml ansible.builtin.include_tasks: compile.yaml
......
# PE to P tasks:
# This is th case of decomm of a PE router <- remove it from all Ps.
# P routers will always be NOKIA
# FIX: Load ansible_network_os via group_vars
#
- name: Set variable to connect to nokia
ansible.legacy.set_fact:
ansible_network_os: geant.gap_ansible.sros
ansible_connection: netconf
# - name: Set ansible_host to terminal server when router is offline
# ansible.legacy.set_fact:
# ansible_host: "{{ subscription.router.router_site.site_ts_address }}"
# ansible_port: "{{ subscription.router.router_ts_port }}"
# when: ( subscription.router.router_access_via_ts | ansible.builtin.bool ) is true
- name: Set vendor var for "remove_pe_from_p" case
ansible.builtin.set_fact:
vendor: "nokia"
- name: Include compile tasks
ansible.builtin.include_tasks: compile.yaml
- name: Include deploy tasks
ansible.builtin.include_tasks: deploy.yaml
delete protocols bgp group iGEANT6-P-ONLY neighbor {{ p_lo_ipv6_address }}
delete protocols bgp group iGEANT-P-ONLY neighbor {{ p_lo_ipv4_address }}
delete protocols bgp group iGEANT6 neighbor {{ subscription.router.router_lo_ipv6_address }}
delete protocols bgp group iGEANT neighbor {{ subscription.router.router_lo_ipv4_address }}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<router> <router>
<router-name>Base</router-name> <router-name>Base</router-name>
<bgp> <bgp>
{% for pe_fqdn, pe_ipadd in pe_router_list.items() %} {% for pe_fqdn, pe_ipadd in pe_router_list.all.hosts.items() %}
<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="replace"> <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="replace">
<ip-address>{{ pe_ipadd.lo4 }}</ip-address> <ip-address>{{ pe_ipadd.lo4 }}</ip-address>
<description>{{ pe_fqdn }}</description> <description>{{ pe_fqdn }}</description>
......
<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 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">
<router-name>Base</router-name>
<bgp 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">
<neighbor alu:operation="delete">
<ip-address>{{ subscription.router.router_lo_ipv4_address }}</ip-address>
</neighbor>
<neighbor alu:operation="delete">
<ip-address>{{ subscription.router.router_lo_ipv6_address }}</ip-address>
</neighbor>
</bgp>
</router>
</configure>
</config>
<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 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">
<neighbor alu:operation="delete">
<ip-address>{{ subscription.router.router_lo_ipv4_address }}</ip-address>
<group>iGEANT</group>
</neighbor>
<neighbor alu:operation="delete">
<ip-address>{{ subscription.router.router_lo_ipv6_address }}</ip-address>
<group>iGEANT6</group>
</neighbor>
</bgp>
</router>
</configure>
</config>
...@@ -8,9 +8,10 @@ verbs: ...@@ -8,9 +8,10 @@ verbs:
- check_p_ibgp - check_p_ibgp
- verify_p_ibgp # Validates the config of BGP stanza including neighbors - 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_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_pe # 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_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 - 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 - promote_p_to_pe # placeholder for future use | Deletes P-GROUP and adds
wfo_router: "{{ subscription }}" wfo_router: "{{ subscription }}"
p_lo_ipv4_address: "{{ wfo_router.router.router_lo_ipv4_address }}" p_lo_ipv4_address: "{{ wfo_router.router.router_lo_ipv4_address }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment