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

iptrunk_checks

Optical PRE and POST checks:
- optical values are extracted per AE member, per lane and are written
into local file of LSO container;
- in the POST check the diff is produced on the optical values of the
remaining side;

Changes to the ping test:
- Separate "rapid" ping and "mtu" ping with the respective "ping_size"
and "ping_count" values (currently in the role's vars).
parent 02084d69
No related branches found
No related tags found
1 merge request!137Fix calculation of Ansible parameters to connect to the nodes
Pipeline #86675 failed
......@@ -14,6 +14,7 @@
lanes: "{{ lanes | default([]) }}"
- name: Populate the lanes data for "{{ ae_member.interface_name }}"
no_log: "{{ my_nolog }}"
ansible.builtin.set_fact:
lanes: "{{ lanes + [{
'lane_id': iface_opt_lane['lane-index'][0]['data'],
......@@ -30,6 +31,7 @@
loop_var: iface_opt_lane
- name: Set variable for the PHY interface
no_log: "{{ my_nolog }}"
ansible.builtin.set_fact:
ae_result: "{{ ae_result | combine({item.key: item.value}) }}"
with_items:
......@@ -64,7 +66,7 @@
text: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
parser:
name: ansible.netcommon.native
template_path: templates/sros_show_port_optical.yaml
template_path: "{{ role_path }}/templates/sros_show_port_optical.yaml"
set_fact: lanes
- name: Set variable for the PHY interface
......
......@@ -10,14 +10,23 @@
ansible.builtin.debug:
var: response.stdout_lines
- name: Ping "{{ remote_side.iptrunk_side_node.router_fqdn }} on {{ side_b_ipv4_address.split('/')[0] }}"
- name: Rapid ping of {{ side_b_ipv4_address.split('/')[0] }}"
junipernetworks.junos.junos_command:
commands: "ping {{ side_b_ipv4_address.split('/')[0] }} rapid size {{ ping_size }} count {{ ping_count }}"
commands: "ping {{ side_b_ipv4_address.split('/')[0] }} rapid size {{ rapid_ping_size }} count {{ rapid_ping_count }}"
register: response
- name: Show ping resulst
- name: Show rapid ping resulst
ansible.builtin.debug:
msg: "{{ response }}"
var: response.stdout_lines[0]
- name: MTU ping of {{ side_b_ipv4_address.split('/')[0] }}"
junipernetworks.junos.junos_command:
commands: "ping {{ side_b_ipv4_address.split('/')[0] }} size {{ mtu_ping_size }} count {{ mtu_ping_count }} do-not-fragment"
register: response
- name: Show MTU ping resulst
ansible.builtin.debug:
var: response.stdout_lines[0]
- name: Nokia LACP check
when: local_side.iptrunk_side_node.vendor == "nokia"
......@@ -39,14 +48,31 @@
ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
- name: Ping "{{ remote_side.iptrunk_side_node.router_fqdn }} on {{ side_b_ipv4_address.split('/')[0] }}"
- name: Rapid ping "{{ remote_side.iptrunk_side_node.router_fqdn }} on {{ side_b_ipv4_address.split('/')[0] }}"
ansible.netcommon.netconf_rpc:
rpc: action
xmlns: "urn:ietf:params:xml:ns:yang:1"
content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>//ping count {{ rapid_ping_count }} size {{ rapid_ping_size }} rapid {{ side_b_ipv4_address.split('/')[0] }}</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
display: json
register: out
- name: Show ping results
ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
- name: MTU ping "{{ remote_side.iptrunk_side_node.router_fqdn }} on {{ side_b_ipv4_address.split('/')[0] }}"
ansible.netcommon.netconf_rpc:
rpc: action
xmlns: "urn:ietf:params:xml:ns:yang:1"
content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>//ping count {{ ping_count }} size {{ ping_size }} rapid {{ side_b_ipv4_address.split('/')[0] }}</md-cli-input-line>
<md-cli-input-line>//ping count {{ mtu_ping_count }} size {{ mtu_ping_size }} {{ side_b_ipv4_address.split('/')[0] }} do-not-fragment</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
display: json
......
......@@ -23,5 +23,5 @@
and
post_file_stat is defined
ansible.utils.fact_diff:
before: "{{ lookup('ansible.builtin.file', 'pre_file_name') }}"
after: "{{ lookup('ansible.builtin.file', 'post_file_name') }}"
before: "{{ lookup('ansible.builtin.file', pre_file_name) }}"
after: "{{ lookup('ansible.builtin.file', post_file_name) }}"
......@@ -15,12 +15,20 @@
dir: /opt/ansible_inventory/group_vars/routers
- name: Load local info
when: >-
inventory_hostname == wfo_ip_trunk_json.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_fqdn
or
inventory_hostname == wfo_ip_trunk_json.iptrunk.iptrunk_sides[1].iptrunk_side_node.router_fqdn
ansible.builtin.set_fact:
local_side: "{{ wfo_ip_trunk_json | community.general.json_query(query) }}"
vars:
query: "iptrunk.iptrunk_sides[?iptrunk_side_node.router_fqdn == '{{ inventory_hostname }}'] | [0]"
- name: Load remote info
when: >-
inventory_hostname == wfo_ip_trunk_json.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_fqdn
or
inventory_hostname == wfo_ip_trunk_json.iptrunk.iptrunk_sides[1].iptrunk_side_node.router_fqdn
ansible.builtin.set_fact:
remote_side: "{{ wfo_ip_trunk_json | community.general.json_query(query) }}"
vars:
......@@ -30,14 +38,41 @@
ansible.builtin.set_fact:
ansible_host: "{{ local_side.iptrunk_side_node.router_site.site_ts_address }}"
ansible_port: "{{ local_side.iptrunk_side_node.router_ts_port }}"
when:
( local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool ) is true
when: >-
local_side is defined
and
local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool
- name: Load netconf connection config
when: local_side is defined
ansible.builtin.set_fact:
ansible_connection: "{{ netconf_access[local_side.iptrunk_side_node.vendor].ansible_connection }}"
ansible_network_os: "{{ netconf_access[local_side.iptrunk_side_node.vendor].ansible_network_os }}"
- name: Set local_side var when new_node is passed to use in optical_post
when: >-
new_node is defined
and
inventory_hostname == new_node.router.router_fqdn
ansible.builtin.set_fact:
ansible_connection: "{{ netconf_access[new_node.router.vendor].ansible_connection }}"
ansible_network_os: "{{ netconf_access[new_node.router.vendor].ansible_network_os }}"
local_side:
iptrunk_side_ae_members: "{{ new_lag_member_interfaces }}"
iptrunk_side_node:
vendor: "{{ new_node.router.vendor }}"
- name: Set ansible_host when new_node is targeted
when: >-
new_node is defined
and
inventory_hostname == new_node.router.router_fqdn
and
new_node.router.router_access_via_ts | ansible.builtin.bool
ansible.builtin.set_fact:
ansible_host: "{{ new_node.router.router_site.site_ts_address }}"
ansible_port: "{{ new_node.router.router_ts_port }}"
- name: Check ISIS
ansible.builtin.include_tasks: check_isis.yaml
when: check == "isis"
......@@ -95,11 +130,14 @@
content: "{{ ae_result | to_nice_yaml }}"
dest: "{{ opt_checks_file }}"
- name: Display "{{ check | upper }}" check results for "{{ inventory_hostname }}"
- name: Display "{{ check | upper }}" check results
when: check == "optical_pre" or check == "optical_post"
ansible.builtin.debug:
msg: "{{ ae_result }}"
- name: Produce the diff of optical check results on the "remaining" side
when: check == "optical_post"
when: >-
check == "optical_post"
and
inventory_hostname != new_node.router.router_fqdn
ansible.builtin.include_tasks: diff_optical_results.yaml
---
# vars file for iptrunks
#
checks:
- isis
- ping
......@@ -9,8 +8,12 @@ checks:
- optical_pre
- optical_post
ping_count: 3
ping_size: 9000
my_nolog: true
mtu_ping_count: 3
mtu_ping_size: 8972
rapid_ping_count: 100
rapid_ping_size: 100
wfo_trunk: "{{ wfo_ip_trunk_json }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment