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.underlay.yaml
76 lines (72 loc) · 2.68 KB
/
pb.check.underlay.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
- name: Checking Underlay health
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 Connectivity between Underlay peers
## Ping are crafted with source and dest IP and TTL one to make
## sure they don't get routed on the fabric
##################################################################
- name: "Check Connectivity using Ping (galaxy/junos_ping)"
junos_ping:
host: "{{ ansible_ssh_host }}"
port: "{{ netconf_port }}"
user: "{{ ansible_ssh_user }}"
passwd: "{{ ansible_ssh_pass }}"
dest_ip: "{{ item.peer_ip }}"
source_ip: "{{ item.local_ip }}"
interface: "{{ item.interface }}"
ttl: 1
with_items: "{{ underlay.neighbors }}"
##################################################################
## Check if all Underlay BGP peers are in Established status
##################################################################
- name: "Check BGP Peer Status (core/junos_command)"
junos_command:
commands:
- "show bgp neighbor {{ item.peer_ip }}"
provider: "{{ credential }}"
waitfor:
- "result[0]['bgp-information']['bgp-peer']['peer-state'] eq Established"
with_items: "{{ underlay.neighbors }}"
###########################################################################
######## LEAF ONLY
###########################################################################
###########################################################################
## Check Connectivity between Underlay Leafs (any to any)
## For each other leaf, pings are sent across all spines with TTL 2
##
###########################################################################
- name: Checking Underlay health cont - Leaf Only
hosts: [leaf]
connection: local
gather_facts: no
pre_tasks:
- include_vars: "{{ topology_file }}"
roles:
- Juniper.junos
tasks:
- name: "Check connectivity ANY2ANY between Leaf (galaxy/junos_ping)"
junos_ping:
host: "{{ ansible_ssh_host }}"
port: "{{ netconf_port }}"
user: "{{ ansible_ssh_user }}"
passwd: "{{ ansible_ssh_pass }}"
interface: "{{ item[0].interface }}"
dest_ip: "{{ hostvars[item[1]].loopback_ip }}"
source_ip: "{{ loopback_ip }}"
ttl: 2
with_nested:
- "{{ underlay.neighbors }}"
- "{{ groups['leaf'] }}"