-
Notifications
You must be signed in to change notification settings - Fork 1
/
pb.check.bgp.overlay.yml
63 lines (58 loc) · 2.16 KB
/
pb.check.bgp.overlay.yml
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
# Copyright 2018, Juniper Networks Pvt Ltd.
# All rights reserved.
# command example: ansible-playbook --ask-vault-pass pb.check.bgp.overlay.yml
# Successfully ran on ansible version: ansible 2.4.2.0: ansible-galaxy list Juniper.junos,1.4.3
---
- name: Check BGP details in the OVERLAY.
hosts: junos-leaf
connection: local
gather_facts: no
tasks:
- name: Verify BGP peers are established in the OVERLAY.
junos_command:
display: 'xml'
commands:
- show bgp neighbor "{{ item.ibgp_peer }}"
waitfor:
- "result[0]['rpc-reply']['bgp-information']['bgp-peer']['peer-state'] eq 'Established'"
retries: 3
interval: 3
provider: "{{ credentials }}"
with_items:
- "{{ ibgp }}"
- name: Verify that the Junos devices learned routes in the OVERLAY network.
junos_command:
display: 'xml'
commands:
- show route receive-protocol bgp "{{ item.ibgp_peer }}" table bgp.evpn.0"
waitfor:
- "result[0]['rpc-reply']['route-information']['route-table']['total-route-count'] gt 5"
retries: 3
interval: 3
provider: "{{ credentials }}"
with_items:
- "{{ ibgp }}"
- name: Verify that VLAN 100 has been extended across the Junos devices OVERLAY network.
junos_command:
display: 'xml'
commands:
- show evpn database neighbor "{{ item.ibgp_peer }}" state default-gateway l2-domain-id 100"
waitfor:
- "result[0]['rpc-reply']['evpn-database-information']['evpn-database-instance']['mac-entry'][ip-address] eq '10.10.10.254'"
retries: 3
interval: 3
provider: "{{ credentials }}"
with_items:
- "{{ ibgp }}"
- name: Verify that VLAN 200 has been extended across the Junos devices OVERLAY network.
junos_command:
display: 'xml'
commands:
- show evpn database neighbor "{{ item.ibgp_peer }}" state default-gateway l2-domain-id 200"
waitfor:
- "result[0]['rpc-reply']['evpn-database-information']['evpn-database-instance']['mac-entry'][ip-address] eq '10.20.20.254'"
retries: 3
interval: 3
provider: "{{ credentials }}"
with_items:
- "{{ ibgp }}"