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 @@ ...@@ -15,7 +15,7 @@
mode: '0755' mode: '0755'
delegate_to: localhost 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" when: verb == "deploy_pe_base_config"
ansible.builtin.template: ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/pe_base_config.j2" src: "routers/{{ subscription.router.vendor }}/pe_base_config.j2"
...@@ -25,11 +25,20 @@ ...@@ -25,11 +25,20 @@
mode: '0755' mode: '0755'
delegate_to: localhost 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" when: verb == "update_sdp_mesh"
ansible.builtin.template: ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/sdp_mesh.j2" src: "routers/{{ subscription.router.vendor }}/pe_update_sdp.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/sdp_mesh.conf" dest: "/var/tmp/ansible_run_{{ opid }}/pe_update_sdp.conf"
lstrip_blocks: true lstrip_blocks: true
trim_blocks: true trim_blocks: true
mode: '0755' mode: '0755'
......
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA] - name: Deploy PE base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >- when: >-
dry_run | ansible.builtin.bool dry_run | ansible.builtin.bool
and verb == "deploy_pe_base_config" and verb == "deploy_pe_base_config"
...@@ -12,6 +12,20 @@ ...@@ -12,6 +12,20 @@
register: output register: output
check_mode: true 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] - name: Deploy SDP mesh on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
when: >- when: >-
dry_run | ansible.builtin.bool dry_run | ansible.builtin.bool
...@@ -19,13 +33,12 @@ ...@@ -19,13 +33,12 @@
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
format: xml format: xml
default_operation: merge 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: true
validate: true validate: true
diff: true diff: true
register: output register: output
check_mode: true check_mode: true
# - name: Fail if there is any diff # - name: Fail if there is any diff
# ansible.builtin.fail: # ansible.builtin.fail:
# msg: Base config drift detected!!! # msg: Base config drift detected!!!
...@@ -47,6 +60,19 @@ ...@@ -47,6 +60,19 @@
diff: true diff: true
check_mode: false 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] - name: Deploy updated SDP mesh on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
when: >- when: >-
not (dry_run | ansible.builtin.bool) and not (dry_run | ansible.builtin.bool) and
...@@ -54,7 +80,7 @@ ...@@ -54,7 +80,7 @@
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
format: xml format: xml
default_operation: merge 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: true
commit_comment: "{{ commit_comment }}" commit_comment: "{{ commit_comment }}"
diff: true diff: true
......
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
ansible.builtin.include_tasks: configure_isis_overload.yaml ansible.builtin.include_tasks: configure_isis_overload.yaml
- name: Include templates compilation - 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 ansible.builtin.include_tasks: compile_pe_base_config.yaml
- name: Include deploy if selected - 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 ansible.builtin.include_tasks: deploy_pe_base_config.yaml
- name: Include deletion of default static routes - name: Include deletion of default static routes
......
...@@ -6,6 +6,8 @@ verbs: ...@@ -6,6 +6,8 @@ verbs:
- remove_isis_overload # Remove overload bit from ISIS config - 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 - 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 - 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_ipv4_address: "{{ subscription.router.router_lo_ipv4_address }}"
lo_ipv6_address: "{{ subscription.router.router_lo_ipv6_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