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

Update SDP mesh

Update SDP mesh will be also called separately, during a step in GSO
(i.e. update all existing Nokia PE routers with this new promoted PE
router).
Hence, a separate playbook and set of new tasks in compily/deploy.
parent 07cce849
No related branches found
No related tags found
1 merge request!162promote-p-to-pe role
- name: Update SDP mesh
hosts: all
gather_facts: false
roles:
- ../roles/promote_p_to_pe
......@@ -16,6 +16,7 @@
delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/base_config.conf"
when: verb == "deploy_pe_base_config"
ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/pe_base_config.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/pe_base_config.conf"
......@@ -24,6 +25,16 @@
mode: '0755'
delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/sdp_mesh.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"
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
......
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: dry_run | ansible.builtin.bool
when: >-
dry_run | ansible.builtin.bool
and verb == "deploy_pe_base_config"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
......@@ -10,6 +12,19 @@
register: output
check_mode: true
- name: Deploy SDP mesh on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >-
dry_run | ansible.builtin.bool
and verb == "update_sdp_mesh"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/sdp_mesh.j2') }}"
commit: true
validate: true
diff: true
register: output
check_mode: true
# - name: Fail if there is any diff
# ansible.builtin.fail:
......@@ -20,7 +35,9 @@
# is_verification_workflow | ansible.builtin.bool
- name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
when: not (dry_run | ansible.builtin.bool)
when: >-
not (dry_run | ansible.builtin.bool) and
verb == "deploy_pe_base_config"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
......@@ -29,3 +46,16 @@
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
verb == "update_sdp_mesh"
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/sdp_mesh.j2') }}"
commit: true
commit_comment: "{{ commit_comment }}"
diff: true
check_mode: false
......@@ -49,11 +49,11 @@
ansible.builtin.include_tasks: configure_isis_overload.yaml
- name: Include templates compilation
when: verb == 'deploy_pe_base_config'
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh' ]
ansible.builtin.include_tasks: compile_pe_base_config.yaml
- name: Include deploy if selected
when: verb == 'deploy_pe_base_config'
when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh' ]
ansible.builtin.include_tasks: deploy_pe_base_config.yaml
- name: Include deletion of default static routes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment