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

Changes to `ibgp_update`

Related to the P -> PE
parent 481b1c87
No related branches found
No related tags found
1 merge request!162promote-p-to-pe role
Showing
with 131 additions and 29 deletions
......@@ -5,18 +5,18 @@
# FIX: Load ansible_network_os via group_vars
#
- name: Set variable to connect to nokia
ansible.legacy.set_fact:
ansible.builtin.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.builtin.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 the vendor variable to select correct template
ansible.legacy.set_fact:
ansible.builtin.set_fact:
vendor: "{{ subscription.router.vendor }}"
- name: Include compile tasks
......
......@@ -3,7 +3,7 @@
ansible_network_os: nokia.sros.md
ansible_connection: netconf
- name: Nokia P - check BGP status
- name: Check BGP status
block:
- name: Get BGP group status
ansible.netcommon.netconf_rpc:
......
---
# tasks file for ibg_update
- name: Print the usage
when: (verb is not defined) or (verb not in verbs)
ansible.builtin.debug:
msg:
- "Allowed verbs: 'add_pe_to_p' and 'add_p_to_pe'. Use: -e 'verb=$verb'."
- "'verb' keyword is mandatory. Usage: -e verb=$verb"
- name: Print defined verbs
when: (verb is not defined) or (verb not in verbs)
ansible.builtin.debug:
msg:
- "Allowed verb: {{ item }}"
loop: "{{ verbs }}"
- name: Fail if arguments are missing
ansible.legacy.meta: end_play
......@@ -30,18 +38,18 @@
- name: Include PE mesh modification tasks
ansible.builtin.include_tasks: modify_pe_mesh.yaml
when: >
verb in [ "add_p_to_pe", "remove_pe_from_pe", "remove_p_from_pe" ]
verb in [ "add_p_to_pe", "add_pe_to_pe_mesh", "remove_pe_from_pe", "remove_p_from_pe" ]
- name: Include PE into P tasks if selected
ansible.builtin.include_tasks: add_pe_to_p.yaml
when: >
verb in [ "add_pe_to_p", "verify_p_ibgp" ]
verb in [ "add_pe_to_p", "verify_p_ibgp", "add_pe_mesh_to_pe" ]
- 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
ansible.builtin.include_tasks: check_p_ibgp.yaml
when: verb == "check_p_ibgp"
- name: Check status of iBGP on Nokia router
ansible.builtin.include_tasks: check_nokia_ibgp.yaml
when: verb in [ "check_p_ibgp", "check_pe_ibgp" ]
set protocols bgp group {{ geant_bgp_groups.pe_mesh.ipv6 }} neighbor {{ subscription_lo_ipv6 }} description {{ subscription_fqdn }}
set protocols bgp group {{ geant_bgp_groups.pe_mesh.ipv4 }} neighbor {{ subscription_lo_ipv4 }} description {{ subscription_fqdn }}
<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>
{% for p_fqdn, p_ipadd in p_router_list.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">
<ip-address>{{ p_ipadd.lo4 }}</ip-address>
<description>{{ p_fqdn }}</description>
<group>{{ geant_bgp_groups.p_only.ipv4 }}</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">
<ip-address>{{ p_ipadd.lo4 }}</ip-address>
<description>{{ p_fqdn }}</description>
<group>{{ geant_bgp_groups.p_only.ipv6 }}</group>
</neighbor>
{% endfor %}
</bgp>
</router>
</configure>
</config>
<router>
<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">
<ip-address>{{ p_lo_ipv4_address }}</ip-address>
<description>{{ p_router_fqdn }}</description>
<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">
<ip-address>{{ p_lo_ipv6_address }}</ip-address>
<description>{{ p_router_fqdn }}</description>
<group>iGEANT-P-ONLY-v6</group>
</neighbor>
</bgp>
</router>
<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">
<ip-address>{{ p_lo_ipv4_address }}</ip-address>
<description>{{ p_router_fqdn }}</description>
<group>{{ geant_bgp_groups.p_only.ipv4 }}</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">
<ip-address>{{ p_lo_ipv6_address }}</ip-address>
<description>{{ p_router_fqdn }}</description>
<group>{{ geant_bgp_groups.p_only.ipv6 }}</group>
</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>
{% for pe_fqdn, pe_ipadd in pe_router_list.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">
<ip-address>{{ pe_ipadd.lo4 }}</ip-address>
<description>{{ pe_fqdn }}</description>
<group>{{ geant_bgp_groups.pe_mesh.ipv4 }}</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="replace">
<ip-address>{{ pe_ipadd.lo6 }}</ip-address>
<description>{{ pe_fqdn }}</description>
<group>{{ geant_bgp_groups.pe_mesh.ipv6 }}</group>
</neighbor>
{% endfor %}
</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>
<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>{{ subscription_lo_ipv4 }}</ip-address>
<description>{{ subscription_fqdn }}</description>
<group>{{ geant_bgp_groups.p_only.ipv4 }}</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="replace">
<ip-address>{{ subscription_lo_ipv6 }}</ip-address>
<description>{{ subscription_fqdn }}</description>
<group>{{ geant_bgp_groups.p_only.ipv6 }}</group>
</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>
<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>{{ subscription_lo_ipv4 }}</ip-address>
<description>{{ subscription_fqdn }}</description>
<group>{{ geant_bgp_groups.pe_mesh.ipv4 }}</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="replace">
<ip-address>{{ subscription_lo_ipv6 }}</ip-address>
<description>{{ subscription_fqdn }}</description>
<group>{{ geant_bgp_groups.pe_mesh.ipv6 }}</group>
</neighbor>
</bgp>
</router>
</configure>
</config>
......@@ -5,9 +5,11 @@
<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>{{ geant_bgp_groups.p_only.ipv4 }}</group>
</neighbor>
<neighbor alu:operation="delete">
<ip-address>{{ subscription.router.router_lo_ipv6_address }}</ip-address>
<group>{{ geant_bgp_groups.p_only.ipv6 }}</group>
</neighbor>
</bgp>
</router>
......
---
# vars file for ibg_update
# vars file for ibgp_update
dry_run: "True"
is_verification_workflow: false
verbs:
- add_pe_to_p # Adds all the existing PEs in the P-GROUP on the newly installed P
- add_p_to_pe # Adds the newly installed P to the P-GROUP in all the existing PEs
- 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_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_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
- promote_p_to_pe # placeholder for future use | Deletes P-GROUP and adds
- add_pe_to_pe_mesh # 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_mesh_to_pe # 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
- check_p_ibgp # Check BGP status on the newly provisioned P router
- check_pe_ibgp # Check BGP status on the newly provisioned PE router
- add_all_p_to_pe # Add P routers to the newly promoted PE router
- add_pe_to_all_p # Add newly promoted PE to all existing P routers
wfo_router: "{{ subscription }}"
p_lo_ipv4_address: "{{ wfo_router.router.router_lo_ipv4_address }}"
p_lo_ipv6_address: "{{ wfo_router.router.router_lo_ipv6_address }}"
p_router_fqdn: "{{ wfo_router.router.router_fqdn }}"
subscription_lo_ipv4: "{{ subscription.router.router_lo_ipv4_address }}"
subscription_lo_ipv6: "{{ subscription.router.router_lo_ipv6_address }}"
subscription_fqdn: "{{ subscription.router.router_fqdn }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment