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 0000000000000000000000000000000000000000..c7feac4e2a956da5a0d94d0e58367f517cc1f58e --- /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 5f0e90ccb2e56037cfd121f9a77927cb71ed28f2..ec17edd49f493126be41b2bc72d71be0dd2046fb 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 cb53fc84bb373f4b44ebb3e11ce9ad65e724a090..18a050f94a1f9e112424710e6e01c869274b5f3a 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