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

ibgp_update: add functionality for validation workflow

parent 0c13df58
No related branches found
No related tags found
1 merge request!151use of defaults inside role
...@@ -30,17 +30,19 @@ ...@@ -30,17 +30,19 @@
commit: true commit: true
validate: true validate: true
diff: true diff: true
register: output
check_mode: true check_mode: true
when: > when: >
( dry_run | ansible.builtin.bool ) is true and ( dry_run | ansible.builtin.bool ) is true and
vendor == "nokia" vendor == "nokia"
- name: Validation succeeded - name: Fail if there is any diff
ansible.builtin.debug: ansible.builtin.fail:
msg: "Base config has been validated against the router and no syntax errors were found" msg: iBGP configuration drifted!!!
when: > when: >
( dry_run | ansible.builtin.bool ) is true and output.changed | ansible.builtin.bool
vendor == "nokia" and
is_verification_workflow | ansible.builtin.bool
- name: Update iBGP mesh ["{{ verb }}"] on "{{ inventory_hostname }}" [AND COMMIT][NOKIA] - name: Update iBGP mesh ["{{ verb }}"] on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
- 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: verb == "add_pe_to_p" when: >
verb in [ "add_pe_to_p", "verify_p_ibgp" ]
- 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
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<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.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"> <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>
<group>iGEANT-P-ONLY</group> <group>iGEANT-P-ONLY</group>
</neighbor> </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"> <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> <ip-address>{{ pe_ipadd.lo6 }}</ip-address>
<description>{{ pe_fqdn }}</description> <description>{{ pe_fqdn }}</description>
<group>iGEANT6-P-ONLY</group> <group>iGEANT6-P-ONLY</group>
......
<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" alu:operation="replace">
<error-handling alu:operation="replace">
<update-fault-tolerance>true</update-fault-tolerance>
</error-handling>
<local-as alu:operation="replace">
<as-number>{{ geant_re_as_number }}</as-number>
</local-as>
<group alu:operation="replace">
<group-name>iGEANT-P-ONLY</group-name>
<admin-state>enable</admin-state>
<next-hop-self>true</next-hop-self>
<type>internal</type>
<peer-as>{{ geant_re_as_number }}</peer-as>
<capability-negotiation>true</capability-negotiation>
<local-address>{{ subscription.router.router_lo_ipv4_address }}</local-address>
<family>
<mcast-ipv4>true</mcast-ipv4>
</family>
</group>
<group alu:operation="replace">
<group-name>iGEANT6-P-ONLY</group-name>
<next-hop-self>true</next-hop-self>
<type>internal</type>
<peer-as>{{ geant_re_as_number }}</peer-as>
<capability-negotiation>true</capability-negotiation>
<local-address>{{ subscription.router.router_lo_ipv6_address }}</local-address>
<family>
<mcast-ipv6>true</mcast-ipv6>
</family>
</group>
{% 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>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="replace">
<ip-address>{{ pe_ipadd.lo6 }}</ip-address>
<description>{{ pe_fqdn }}</description>
<group>iGEANT6-P-ONLY</group>
</neighbor>
{% endfor %}
</bgp>
</router>
</configure>
</config>
--- ---
# vars file for ibg_update # vars file for ibg_update
dry_run: "True" dry_run: "True"
is_verification_workflow: false
verbs: verbs:
- add_pe_to_p # Adds all the existing PEs in the P-GROUP on the newly installed P - 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 - add_p_to_pe # Adds the newly installed P to the P-GROUP in all the existing PEs
- check_p_ibgp - 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_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
- 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment