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

Merge branch 'verification_workflows_tentative1' into 'develop'

use of defaults inside role

See merge request !151
parents 4d544fc0 f3417e79
No related branches found
No related tags found
1 merge request!151use of defaults inside role
Pipeline #87566 passed
Showing
with 109 additions and 26 deletions
---
# defaults file for base_config
# ansible_net_has_2RE: false # safe to set because when ansible gets this var from the real Juniper box, it will be overwritten.
......@@ -5,9 +5,12 @@
src_format: text
check_commit: true
diff: true
register: output
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is true and
verb == "deploy"
and
( dry_run | ansible.builtin.bool )
and
wfo_router.router.vendor == "juniper"
......@@ -19,8 +22,10 @@
comment: "{{ commit_comment }}"
diff: true
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is false and
verb == "deploy"
and
not ( dry_run | ansible.builtin.bool )
and
wfo_router.router.vendor == "juniper"
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
......@@ -32,18 +37,33 @@
commit: true
validate: true
diff: true
register: output
check_mode: true
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is true and
verb == "deploy"
and
( dry_run | ansible.builtin.bool )
and
wfo_router.router.vendor == "nokia"
- name: Fail if there is any diff
ansible.builtin.fail:
msg: Base config drift detected!!!
when: >
output.changed | ansible.builtin.bool
and
is_verification_workflow | ansible.builtin.bool
- name: Validation succeeded
ansible.builtin.debug:
msg: "Base config has been validated against the router and no syntax errors were found"
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is true and
verb == "deploy"
and
( dry_run | ansible.builtin.bool )
and
wfo_router.router.vendor == "nokia"
......@@ -58,14 +78,18 @@
diff: true
check_mode: false
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is false and
verb == "deploy"
and
not ( dry_run | ansible.builtin.bool )
and
wfo_router.router.vendor == "nokia"
- name: PLEASE CHECK THE CONFIG ON THE BOX
ansible.builtin.debug:
msg: "Base config has been deployed, check on the router for the result"
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is false and
verb == "deploy"
and
not ( dry_run | ansible.builtin.bool )
and
wfo_router.router.vendor == "nokia"
......@@ -5,7 +5,7 @@
<contact alu:operation="replace">{{ nokia_system_contact }}</contact>
<name alu:operation="replace">{{ short_hostname}}</name>
<location alu:operation="replace">{{ nokia_snmp_location }}</location>
<load-balancing>
<load-balancing alu:operation="replace">
<l4-load-balancing>true</l4-load-balancing>
<lsr-load-balancing>lbl-ip-l4-teid</lsr-load-balancing>
<system-ip-load-balancing>true</system-ip-load-balancing>
......
......@@ -32,7 +32,7 @@
{% endfor %}
{% endfor %}
</network-queue>
<network alu:operation="replace">
<network alu:operation="replace">
{% for net_pol in nokia_qos_network_policies %}
<network-policy-name>{{ net_pol.name }}</network-policy-name>
<description>{{ net_pol.description }}</description>
......@@ -46,7 +46,7 @@
<dscp>
<dscp-name>{{ dscp.name}}</dscp-name>
<fc>{{ dscp.fc }}</fc>
<profile>{{ dscp.profile }}</profile>
<profile>{{ dscp.profile }}</profile>
</dscp>
{% endfor %}
{% for lsp_exp in net_pol.ingress.lsp_exp %}
......
......@@ -20,10 +20,10 @@
</ipv6>
</interface>
<mpls-labels 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">
<static-label-range>9968</static-label-range>
<static-label-range>{{ mpls_labels.static_label_range }}</static-label-range>
<sr-labels>
<start>10000</start>
<end>19999</end>
<start>{{ mpls_labels.sr_label_start }}</start>
<end>{{ mpls_labels.sr_label_end }}</end>
</sr-labels>
</mpls-labels>
<mpls 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">
......
dry_run: "True"
is_base_config_run: "True"
is_verification_workflow: false
verbs:
- "compile"
- "deploy"
......
......@@ -30,17 +30,19 @@
commit: true
validate: true
diff: true
register: output
check_mode: true
when: >
( dry_run | ansible.builtin.bool ) is true and
vendor == "nokia"
- name: Validation succeeded
ansible.builtin.debug:
msg: "Base config has been validated against the router and no syntax errors were found"
- name: Fail if there is any diff
ansible.builtin.fail:
msg: iBGP configuration drifted!!!
when: >
( dry_run | ansible.builtin.bool ) is true and
vendor == "nokia"
output.changed | ansible.builtin.bool
and
is_verification_workflow | ansible.builtin.bool
- name: Update iBGP mesh ["{{ verb }}"] on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
......
......@@ -29,7 +29,8 @@
- name: Include PE into P tasks if selected
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
ansible.builtin.include_tasks: check_p_ibgp.yaml
......
......@@ -4,12 +4,12 @@
<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">
<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">
<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>
......
<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
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
- 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment