blob: 585820a6eb6b9534a37131afbfdcbbb807d2c582 (
plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
---
- debug: msg="START connection={{ ansible_connection }} nxos_bgp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: neighbor_down_fib_accelerate="true"
when: not titanium
- set_fact: reconnect_interval="55"
when: not titanium
- name: "Enable feature BGP"
nxos_feature:
feature: bgp
state: enabled
provider: "{{ connection }}"
ignore_errors: yes
- name: "Setup"
nxos_bgp: &remove
asn: 65535
state: absent
provider: "{{ connection }}"
ignore_errors: yes
register: result
- block:
- name: "Configure BGP defaults"
nxos_bgp: &configure_default
asn: 65535
router_id: 1.1.1.1
state: present
provider: "{{ connection }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Check Idempotence"
nxos_bgp: *configure_default
register: result
- assert: &false
that:
- "result.changed == false"
- name: "Remove BGP"
nxos_bgp: *remove
register: result
- assert: *true
- name: "Check Idempotence"
nxos_bgp: *remove
register: result
- assert: *false
- name: "Configure BGP non defaults"
nxos_bgp: &configure_non_default
asn: 65535
router_id: 1.1.1.1
bestpath_always_compare_med: true
bestpath_aspath_multipath_relax: true
bestpath_compare_routerid: true
bestpath_cost_community_ignore: true
bestpath_med_confed: true
bestpath_med_missing_as_worst: true
bestpath_med_non_deterministic: true
cluster_id: 10.0.0.1
confederation_id: 99
disable_policy_batching: true
enforce_first_as: false
fast_external_fallover: false
flush_routes: true
graceful_restart_helper: true
graceful_restart_timers_restart: 130
graceful_restart_timers_stalepath_time: 310
isolate: false
log_neighbor_changes: true
maxas_limit: 50
neighbor_down_fib_accelerate: "{{neighbor_down_fib_accelerate|default(omit)}}"
reconnect_interval: "{{reconnect_interval|default(omit)}}"
shutdown: true
timer_bestpath_limit: 255
timer_bgp_hold: 110
timer_bgp_keepalive: 45
event_history_cli: size_medium
event_history_detail: size_large
event_history_events: size_medium
event_history_periodic: size_small
suppress_fib_pending: true
state: present
provider: "{{ connection }}"
register: result
- assert: *true
- name: "Check Idempotence"
nxos_bgp: *configure_non_default
register: result
- assert: *false
- name: "Remove BGP"
nxos_bgp: *remove
register: result
- assert: *true
- name: "Check Idempotence"
nxos_bgp: *remove
register: result
- assert: *false
- name: "Disable feature bgp"
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
rescue:
- name: "Cleanup BGP"
nxos_bgp: *remove
ignore_errors: yes
- name: "Disable feature bgp"
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
always:
- debug: msg="END connection={{ ansible_connection }} nxos_bgp sanity test"
|