This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
/
pb.check.physical.yaml
61 lines (56 loc) · 2.11 KB
/
pb.check.physical.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
- name: Checking Physical Layer status
hosts: [spine,leaf]
connection: local
gather_facts: no
pre_tasks:
- include_vars: "{{ topology_file }}"
vars:
credential:
host: "{{ ansible_ssh_host }}"
port: "{{ netconf_port }}"
username: "{{ ansible_ssh_user }}"
password: "{{ ansible_ssh_pass }}"
roles:
- Juniper.junos
tasks:
##################################################################
## Check if all physical interfaces that are part of the Underlay are UP
##################################################################
- name: "Check Physical Interface Status (core/junos_command)"
junos_command:
commands:
- "show interfaces terse {{ item.interface }}"
provider: "{{ credential }}"
waitfor:
- "result[0]['interface-information']['physical-interface']['oper-status'] eq up"
with_items: "{{ underlay.neighbors }}"
register: ints
##################################################################
## Check all LLDP neighbors
##################################################################
- name: "Check LLDP neighbors (core/junos_command)"
junos_command:
commands:
- "show lldp neighbors interface {{ item.interface }}"
provider: "{{ credential }}"
waitfor:
- "result[0]['lldp-neighbors-information']['lldp-neighbor-information']['lldp-remote-system-name'] eq {{ item.name }}"
with_items: "{{ underlay.neighbors }}"
register: lldp
##################################################################
## Check interface counter
##################################################################
- name: "Check Interfaces counters (galaxy/junos_jsnapy)"
ignore_errors: true
junos_jsnapy:
host: "{{ ansible_ssh_host }}"
port: "{{ netconf_port }}"
user: "{{ ansible_ssh_user }}"
passwd: "{{ ansible_ssh_pass }}"
test_files: tests/test_junos_interface_ext.yaml
action: snapcheck
register: test1
- name: Check JSNAPy tests results
assert:
that:
- "test1.passPercentage == 100"