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

Added verbs

- deploy_routing_instances
- update_sdp_mesh
parent dc15912b
No related branches found
No related tags found
1 merge request!162promote-p-to-pe role
......@@ -15,7 +15,7 @@
mode: '0755'
delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/base_config.conf"
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_base_config.conf"
when: verb == "deploy_pe_base_config"
ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/pe_base_config.j2"
......@@ -25,11 +25,20 @@
mode: '0755'
delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/sdp_mesh.conf"
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_base_vprn.conf"
when: verb == "deploy_routing_instances"
ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/pe_base_vprn.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/pe_base_vprn.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_update_sdp.conf"
when: verb == "update_sdp_mesh"
ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/sdp_mesh.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/sdp_mesh.conf"
src: "routers/{{ subscription.router.vendor }}/pe_update_sdp.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/pe_update_sdp.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
......
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
- name: Deploy PE base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >-
dry_run | ansible.builtin.bool
and verb == "deploy_pe_base_config"
......@@ -12,6 +12,20 @@
register: output
check_mode: true
- name: Deploy PE base VPRNs on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >-
dry_run | ansible.builtin.bool
and verb == "deploy_routing_instances"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_base_vprn.j2') }}"
commit: true
validate: true
diff: true
register: output
check_mode: true
- name: Deploy SDP mesh on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >-
dry_run | ansible.builtin.bool
......@@ -19,13 +33,12 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/sdp_mesh.j2') }}"
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_update_sdp.j2') }}"
commit: true
validate: true
diff: true
register: output
check_mode: true
# - name: Fail if there is any diff
# ansible.builtin.fail:
# msg: Base config drift detected!!!
......@@ -47,6 +60,19 @@
diff: true
check_mode: false
- name: Deploy PE base VPRNs on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
when: >-
not (dry_run | ansible.builtin.bool) and
verb == "deploy_routing_instances"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_base_vprn.j2') }}"
commit: true
commit_comment: "{{ commit_comment }}"
diff: true
check_mode: false
- name: Deploy updated SDP mesh on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
when: >-
not (dry_run | ansible.builtin.bool) and
......@@ -54,7 +80,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/sdp_mesh.j2') }}"
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_update_sdp.j2') }}"
commit: true
commit_comment: "{{ commit_comment }}"
diff: true
......
......@@ -49,11 +49,11 @@
ansible.builtin.include_tasks: configure_isis_overload.yaml
- name: Include templates compilation
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh' ]
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh' , 'deploy_routing_instances' ]
ansible.builtin.include_tasks: compile_pe_base_config.yaml
- name: Include deploy if selected
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh' ]
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh', 'deploy_routing_instances' ]
ansible.builtin.include_tasks: deploy_pe_base_config.yaml
- name: Include deletion of default static routes
......
......@@ -6,6 +6,8 @@ verbs:
- remove_isis_overload # Remove overload bit from ISIS config
- deploy_pe_base_config # Deploy PE-specific base config on top of existing P-only config
- delete_default_routes # Delete default static routes configured as part P base-config
- deploy_routing_instances # Deploy standard PE VPRNs
- update_sdp_mesh # Upadate SDP mesh on other Nokia PE routers with this promoted router
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