forked from JNPRAutomate/ansible-junos-evpn-vxlan
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpb.check.overlay.yaml
59 lines (55 loc) · 2.17 KB
/
pb.check.overlay.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
- name: Checking Overlay 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 Overlay 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 between Overlay neighbor using Ping (galaxy/junos_ping)"
with_items: "{{ overlay.neighbors }}"
junos_ping:
host: "{{ ansible_ssh_host }}"
port: "{{ netconf_port }}"
user: "{{ ansible_ssh_user }}"
passwd: "{{ ansible_ssh_pass }}"
dest_ip: "{{ item }}"
source_ip: "{{ loopback_ip }}"
ttl: 1
##################################################################
## Check if Overlay BGP peers between Spine/Leaf are in Established status
##################################################################
- name: "Check BGP Peer between Spine/Leaf Status (core/junos_command)"
junos_command:
commands:
- "show bgp neighbor {{ item }}"
provider: "{{ credential }}"
waitfor:
- "result[0]['bgp-information']['bgp-peer']['peer-state'] eq Established"
with_items: "{{ overlay.neighbors }}"
register: bgp
##################################################################
## Check if Overlay BGP peers between Spine/Leaf are in Established status
##################################################################
- name: "Check BGP Peer between Spine/RR Status (core/junos_command)"
junos_command:
commands:
- "show bgp neighbor {{ item }}"
provider: "{{ credential }}"
waitfor:
- "result[0]['bgp-information']['bgp-peer']['peer-state'] eq Established"
with_items: "{{ overlay.rr_bgp }}"
when: overlay.rr_bgp is defined
register: bgp_rr