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

Termination workflow

Tested cases:
- Add P routers to PE
- Terminate a PE (will remove PE from PE-mesh, and remove PE from
P-routers).
parent 706ce6a6
No related branches found
No related tags found
1 merge request!157ibgp_update modifications
Pipeline #88043 passed
......@@ -23,20 +23,21 @@
ansible.builtin.debug:
msg: "{{ opid }}"
- name: Include P into PEs tasks if selected
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" ]
verb in [ "add_p_to_pe", "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" ]
- 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"
......@@ -4,18 +4,17 @@
- name: Adjust network connection according to the vendor
block:
#
- name: Set variable to connect to nokia
ansible.legacy.set_fact:
ansible_network_os: geant.gap_ansible.sros
ansible_connection: netconf
when: vendor == "nokia"
- name: Set variable to connect to nokia
ansible.legacy.set_fact:
ansible_network_os: geant.gap_ansible.sros
ansible_connection: netconf
when: vendor == "nokia"
- name: Set variables for connecting to Junos
ansible.legacy.set_fact:
ansible_network_os: junos
ansible_connection: netconf
when: vendor == "juniper"
- name: Set variables for connecting to Junos
ansible.legacy.set_fact:
ansible_network_os: junos
ansible_connection: netconf
when: vendor == "juniper"
- name: Include compile tasks
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
......@@ -3,7 +3,7 @@
<router>
<router-name>Base</router-name>
<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">
<ip-address>{{ pe_ipadd.lo4 }}</ip-address>
<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>
<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>
<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">
<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-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">
<neighbor alu:operation="delete">
<ip-address>{{ subscription.router.router_lo_ipv6_address }}</ip-address>
<group>iGEANT6-P-ONLY</group>
</neighbor>
</bgp>
</router>
......
......@@ -9,7 +9,7 @@ verbs:
- 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
- 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment