diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile_pe_base_config.yaml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile_pe_base_config.yaml index e9c7c23e4b1d8258f782823e669e47d32bb58a70..d374f30c4ffc2a74ba15d8ef862f98e446ca2f30 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile_pe_base_config.yaml +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile_pe_base_config.yaml @@ -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' diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy_pe_base_config.yaml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy_pe_base_config.yaml index 3503ab204ba834bd20339f6ba7dddd5e06781cb4..5e2f1fe028f5085d65c026fb648bcef16901c18e 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy_pe_base_config.yaml +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/deploy_pe_base_config.yaml @@ -1,4 +1,4 @@ -- 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 diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml index 41dc0e6e8888dd8dd840c5ab89808d285027858f..02a469925821be24be6457708ace1c0898d0fc0c 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml @@ -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 diff --git a/geant/gap_ansible/roles/promote_p_to_pe/vars/main.yml b/geant/gap_ansible/roles/promote_p_to_pe/vars/main.yml index a940cf7c144cef578cb82042450a5500ff445a09..dd26c7d39e2b69a5a9d88c29c8d8e76f82aceb35 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/vars/main.yml +++ b/geant/gap_ansible/roles/promote_p_to_pe/vars/main.yml @@ -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 }}"