diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/checks_single_command.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/checks_single_command.j2 new file mode 120000 index 0000000000000000000000000000000000000000..86b250704dbdc1b5799bba2d0f173d5f42dbf6e0 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/checks_single_command.j2 @@ -0,0 +1 @@ +../../../base_config_checks/templates/base_config_single_command.j2 \ No newline at end of file diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/command_checks.yaml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/command_checks.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4d95f8c4f566ebfe0798c217799099597cde1a42 --- /dev/null +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/command_checks.yaml @@ -0,0 +1,10 @@ +- name: "Execute {{ item.command }}" + ansible.netcommon.netconf_rpc: + rpc: action + xmlns: "urn:ietf:params:xml:ns:yang:1" + content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/checks_single_command.j2') }}" + display: json + register: out +- name: "Results of {{ item.command }}" + ansible.builtin.debug: + msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}" 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 d7a7208af17663f62cc072d8ff04a0bd56cef407..16eabc11b5ff4ce56024a3238b4b58bb99ed04a3 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 @@ -43,10 +43,10 @@ - name: Print the ID ansible.builtin.debug: msg: "{{ opid }}" - -- name: Include ISIS overload tasks - when: verb in ['set_isis_overload', 'remove_isis_overload'] - ansible.builtin.include_tasks: configure_isis_overload.yaml +# +# - name: Include ISIS overload tasks +# when: verb in ['set_isis_overload', 'remove_isis_overload'] +# 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' ] @@ -56,6 +56,16 @@ when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh', 'deploy_routing_instances', 'delete_default_routes' ] ansible.builtin.include_tasks: deploy.yaml +- name: PRE checks + when: verb == "post_checks" + ansible.builtin.include_tasks: command_checks.yaml + loop: "{{ pre_check_commands }}" + +- name: POST checks + when: verb == "post_checks" + ansible.builtin.include_tasks: command_checks.yaml + loop: "{{ post_check_commands }}" + - name: Check VPRNs when: verb == "check_base_ris" loop: "{{ pe_vprns }}" 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 21a8dbcc295917ad6ac969031650c339751c7730..b6ad21f819ad82071996a31bf303d55a77fe2abe 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 @@ -11,8 +11,55 @@ verbs: - deploy_routing_instances # Deploy standard PE VPRNs - update_sdp_mesh # Upadate SDP mesh on other Nokia PE routers with this promoted router - check_base_ris # Check BGP summary for base VPRNs + - pre_checks + - post_checks lo_ipv4_address: "{{ subscription.router.router_lo_ipv4_address }}" lo_ipv6_address: "{{ subscription.router.router_lo_ipv6_address }}" router_tier: "{{ subscription.router.router_site.site_tier }}" router_role: "{{ subscription.router.router_role }}" + +post_check_commands: + - command: show router route-table summary | match ISIS + - command: show router isis interface | match '^[a-z]' + - command: show router isis adjacency | match '^[a-z]' + - command: show router mpls interface | match '^[a-z]' + - command: show router rsvp interface | match '^[a-z]' + - command: show router rsvp neighbor | match '^[1-9]' + - command: show router rsvp session | match "Up" + - command: show router pim interface | match "Up" + - command: show router pim neighbor | match '^[a-z|A-Z]' + - command: show router pim status | match '(State|RPF Table)' + - command: show router pim group | match '^[1-9]' | no-more + - command: show router route-table mcast-ipv4 summary + - command: show router route-table mcast-ipv6 summary + - command: show router bgp summary group "iGEANT" + - command: show router bgp summary group "iGEANT6" + - command: show router bgp summary group "iGEANT-P-ONLY" + - command: show router bgp summary group "iGEANT6-P-ONLY" + - command: show service sdp + - command: show router route-table 0.0.0.0/0 + - command: show router route-table ::/0 + - command: show router Base route-table summary + - command: show router 21320 route-table summary + - command: show cflowd status | match '(Timeout|Retrans)' + - command: show cflowd collector | match '^[0-9]' + - command: show router Base origin-validation rpki-session detail + - command: show router Base bgp routes 5.150.67.0/24 detail | match '(Network|Final|Community|Attri)' + - command: show router Base bgp routes community ext:4300:0 | count + - command: show router Base bgp routes community ext:4300:1 | count + +pre_check_commands: + - command: show router route-table summary | match ISIS + - command: show router isis interface | match '^[a-z]' + - command: show router isis adjacency | match '^[a-z]' + - command: show router mpls interface | match '^[a-z]' + - command: show router rsvp interface | match '^[a-z]' + - command: show router rsvp neighbor | match '^[1-9]' + - command: show router rsvp session | match "Up" + - command: show router pim interface | match "Up" + - command: show router pim neighbor | match '^[a-z|A-Z]' + - command: show router pim status | match '(State|RPF Table)' + - command: show router pim group | match '^[1-9]' | no-more + - command: show router route-table mcast-ipv4 summary + - command: show router route-table mcast-ipv6 summary