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

Merge branch 'feature/promote-p-to-pe-static-routes' into 'develop'

PE static routes as a separate step in P-to-PE WF

See merge request !207
parents dcb4d5c6 bb5052de
No related branches found
No related tags found
1 merge request!207PE static routes as a separate step in P-to-PE WF
Pipeline #91217 passed
{% if router_role == 'pe' or is_pe_promotion_wf %}
{% if router_role == 'pe' %}
{% with static_routes_obj=nokia_pe_static_routes %}
{% include 'router/static_routes.j2' %}
{% endwith %}
......
{% with static_routes_obj=nokia_pe_static_routes %}
<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>
{% include './static_routes.j2' %}
</router>
</configure>
</config>
{% endwith %}
......@@ -55,6 +55,16 @@
mode: '0755'
delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_promotion_static_routes.conf"
when: verb == "add_pe_static_routes"
ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/router/pe_promotion_static_routes.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/pe_promotion_static_routes.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
delegate_to: localhost
- name: Set back ansible_host to target terminal server if needed
when:
subscription.router.router_access_via_ts | ansible.builtin.bool and
......
......@@ -58,6 +58,21 @@
register: output
check_mode: true
- name: Add PE static routes on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >-
dry_run | ansible.builtin.bool
and verb == "add_pe_static_routes"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/router/pe_promotion_static_routes.j2') }}"
commit: true
validate: true
config_mode: private
diff: true
register: output
check_mode: true
# - name: Fail if there is any diff
# ansible.builtin.fail:
# msg: Base config drift detected!!!
......@@ -121,3 +136,17 @@
config_mode: private
diff: true
check_mode: false
- name: Add PE static routes on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
when: >-
not (dry_run | ansible.builtin.bool)
and verb == "add_pe_static_routes"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/router/pe_promotion_static_routes.j2') }}"
commit: true
commit_comment: "{{ commit_comment }}"
config_mode: private
diff: true
check_mode: false
......@@ -50,11 +50,11 @@
# ansible.builtin.include_tasks: configure_isis_overload.yaml
- name: Include templates compilation
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh' , 'deploy_routing_instances', 'delete_default_routes' ]
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh', 'deploy_routing_instances', 'delete_default_routes', 'add_pe_static_routes' ]
ansible.builtin.include_tasks: compile.yaml
- name: Include deploy if selected
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh', 'deploy_routing_instances', 'delete_default_routes' ]
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh', 'deploy_routing_instances', 'delete_default_routes', 'add_pe_static_routes' ]
ansible.builtin.include_tasks: deploy.yaml
- name: PRE checks
......
......@@ -13,6 +13,7 @@ verbs:
- check_base_ris # Check BGP summary for base VPRNs
- pre_checks
- post_checks
- add_pe_static_routes # Add PE-specific static routes as a separate WF step to avoid blackholing
lo_ipv4_address: "{{ subscription.router.router_lo_ipv4_address }}"
lo_ipv6_address: "{{ subscription.router.router_lo_ipv6_address }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment