From 10c0f093b06978171eae94180520fa7d798c5780 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <aleksandr.kurbatov@GL1342.local> Date: Tue, 2 Jul 2024 19:43:17 +0100 Subject: [PATCH] `iptrunk_checks` updates - added BFD check --- .../roles/iptrunk_checks/tasks/check_bfd.yaml | 31 +++++++++++++++++++ .../roles/iptrunk_checks/tasks/main.yml | 4 +++ .../roles/iptrunk_checks/vars/main.yml | 1 + 3 files changed, 36 insertions(+) create mode 100644 geant/gap_ansible/roles/iptrunk_checks/tasks/check_bfd.yaml diff --git a/geant/gap_ansible/roles/iptrunk_checks/tasks/check_bfd.yaml b/geant/gap_ansible/roles/iptrunk_checks/tasks/check_bfd.yaml new file mode 100644 index 00000000..c7feac4e --- /dev/null +++ b/geant/gap_ansible/roles/iptrunk_checks/tasks/check_bfd.yaml @@ -0,0 +1,31 @@ +- name: Juniper BFD check + when: local_side.iptrunk_side_node.vendor == "juniper" + block: + - name: Get status of BFD for neighbor "{{ new_node.router.router_lo_ipv4_address }}" + junipernetworks.junos.junos_command: + commands: + - show bfd session address "{{ new_node.router.router_lo_ipv4_address }}" + register: response + + - name: Show status of BFD neigbor + ansible.builtin.debug: + msg: "{{ response.stdout_lines[0] }}" + +- name: Nokia BFD check + when: local_side.iptrunk_side_node.vendor == "nokia" + block: + - name: Get status of BFD for neighbor "{{ new_node.router.router_lo_ipv4_address }}" + 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>show lag {{ local_side.iptrunk_side_ae_iface | lower }} bfd</md-cli-input-line> + </md-cli-raw-command> + </global-operations> + display: json + register: out + - name: Show BFD status + ansible.builtin.debug: + msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}" diff --git a/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml b/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml index 5f0e90cc..ec17edd4 100644 --- a/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml +++ b/geant/gap_ansible/roles/iptrunk_checks/tasks/main.yml @@ -81,6 +81,10 @@ ansible.builtin.include_tasks: check_trunk_interface.yaml when: check == "ping" +- name: Check BFD + ansible.builtin.include_tasks: check_bfd.yaml + when: check == "bfd" + - name: Set the optical checks results directory name when: check == "optical_pre" or check == "optical_post" ansible.builtin.set_fact: diff --git a/geant/gap_ansible/roles/iptrunk_checks/vars/main.yml b/geant/gap_ansible/roles/iptrunk_checks/vars/main.yml index cb53fc84..18a050f9 100644 --- a/geant/gap_ansible/roles/iptrunk_checks/vars/main.yml +++ b/geant/gap_ansible/roles/iptrunk_checks/vars/main.yml @@ -2,6 +2,7 @@ # vars file for iptrunks # checks: + - bfd - isis - ping - lacp -- GitLab