Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/playbooks/common_examples/sonic_bgp.yaml

raw symbols SCIP
1 ---
2 - name: Ansible Enterprise SONiC BGP resource module example
3 hosts: datacenter
4 gather_facts: false
5 connection: httpapi
6 collections:
7 - dellemc.enterprise_sonic
8 vars:
9 bgp_as1: 4
10 bgp_as2: 10
11 bgp_as3: 11
12 vrf1: VrfCheck1
13 tasks:
14 - name: "Configure route map configurations"
15 vars:
16 ansible_connection: network_cli
17 sonic_config:
18 commands:
19 - route-map aa permit 11
20 - route-map bb permit 22
21 - ip prefix-list p1 seq 1 permit 1.1.1.0/24
22 - ip prefix-list p2 seq 2 permit 2.2.2.128/25
23 save: true
24 - name: Configure VRFs
25 sonic_vrfs:
26 config:
27 - name: "{{ vrf1 }}"
28 - name: "Test sonic_bgp"
29 sonic_bgp:
30 config:
31 - bgp_as: "{{ bgp_as1 }}"
32 router_id: 10.2.2.4
33 log_neighbor_changes: false
34 bestpath:
35 as_path:
36 confed: true
37 ignore: true
38 multipath_relax: false
39 multipath_relax_as_set: true
40 compare_routerid: true
41 med:
42 confed: true
43 missing_as_worst: true
44 max_med:
45 on_startup:
46 timer: 667
47 med_val: 7878
48 - bgp_as: "{{ bgp_as2 }}"
49 log_neighbor_changes: true
50 vrf_name: "{{ vrf1 }}"
51 bestpath:
52 as_path:
53 confed: false
54 ignore: true
55 multipath_relax_as_set: true
56 compare_routerid: true
57 med:
58 confed: true
59 missing_as_worst: true
60 max_med:
61 on_startup:
62 timer: 332
63 med_val: 9987
64 state: merged
65 - name: "Test sonic_bgp_af merge 01"
66 sonic_bgp_af:
67 config:
68 - bgp_as: "{{ bgp_as1 }}"
69 address_family:
70 afis:
71 - afi: ipv4
72 safi: unicast
73 advertise_all_vni: false
74 redistribute:
75 - metric: "20"
76 protocol: connected
77 route_map: aa
78 - metric: "26"
79 protocol: ospf
80 route_map: bb
81 - metric: "25"
82 protocol: static
83 route_map: aa
84 - afi: ipv6
85 safi: unicast
86 advertise_all_vni: true
87 redistribute:
88 - metric: "21"
89 protocol: connected
90 route_map: bb
91 - metric: "27"
92 protocol: ospf
93 route_map: aa
94 - metric: "28"
95 protocol: static
96 route_map: aa
97 - afi: l2vpn
98 safi: evpn
99 advertise_all_vni: true
100 advertise_default_gw: true
101 route_advertise_list:
102 - advertise_afi: ipv4
103 route_map: aa
104 - advertise_afi: ipv6
105 route_map: bb
106 - bgp_as: "{{ bgp_as2 }}"
107 vrf_name: "{{ vrf1 }}"
108 address_family:
109 afis:
110 - afi: ipv4
111 safi: unicast
112 redistribute:
113 - metric: "20"
114 protocol: connected
115 route_map: aa
116 - metric: "26"
117 protocol: ospf
118 route_map: bb
119 - metric: "25"
120 protocol: static
121 route_map: aa
122 - afi: ipv6
123 safi: unicast
124 redistribute:
125 - metric: "21"
126 protocol: connected
127 route_map: bb
128 - metric: "27"
129 protocol: ospf
130 route_map: aa
131 - metric: "28"
132 protocol: static
133 route_map: aa
134 - afi: l2vpn
135 safi: evpn
136 advertise_default_gw: true
137 route_advertise_list:
138 - advertise_afi: ipv4
139 route_map: aa
140 - advertise_afi: ipv6
141 route_map: bb
142 state: merged
143 - name: "Test sonic_bgp_neighbors merged state"
144 sonic_bgp_neighbors:
145 config:
146 - bgp_as: "{{ bgp_as1 }}"
147 peer_group:
148 - name: SPINE
149 remote_as:
150 peer_type: internal
151 bfd:
152 check_failure: true
153 enabled: true
154 profile: 'profile 1'
155 advertisement_interval: 15
156 timers:
157 keepalive: 50
158 holdtime: 40
159 capability:
160 dynamic: true
161 extended_nexthop: true
162 address_family:
163 afis:
164 - afi: ipv4
165 safi: unicast
166 ip_afi:
167 default_policy_name: aa
168 send_default_route: false
169 prefix_limit:
170 max_prefixes: 200
171 prevent_teardown: false
172 warning_threshold: 88
173 restart_timer: 5
174 prefix_list_in: p2
175 prefix_list_out: p1
176 - name: SPINE2
177 neighbors:
178 - neighbor: Eth1/1
179 remote_as:
180 peer_type: internal
181 peer_group: SPINE
182 advertisement_interval: 10
183 timers:
184 keepalive: 40
185 holdtime: 50
186 bfd:
187 enabled: false
188 capability:
189 dynamic: true
190 extended_nexthop: true
191 - neighbor: 192.168.1.4
192 - neighbor: Eth1/2
193 remote_as:
194 peer_as: 3
195 peer_group: SPINE2
196 advertisement_interval: 20
197 timers:
198 keepalive: 30
199 holdtime: 20
200 capability:
201 dynamic: true
202 - bgp_as: "{{ bgp_as2 }}"
203 vrf_name: "{{ vrf1 }}"
204 peer_group:
205 - name: SPINE3
206 remote_as:
207 peer_type: internal
208 bfd:
209 check_failure: false
210 enabled: true
211 profile: 'profile 3'
212 advertisement_interval: 15
213 timers:
214 keepalive: 50
215 holdtime: 40
216 capability:
217 dynamic: true
218 extended_nexthop: true
219 neighbors:
220 - neighbor: Eth1/11
221 peer_group: SPINE3
222 - neighbor: Eth1/12
223 state: merged
224 - name: "Test sonic_bgp_neighbors_af merge 01"
225 sonic_bgp_neighbors_af:
226 config:
227 - bgp_as: "{{ bgp_as1 }}"
228 neighbors:
229 - neighbor: Eth1/1
230 address_family:
231 - afi: ipv4
232 safi: unicast
233 activate: true
234 allowas_in:
235 value: 6
236 route_map:
237 - name: aa
238 direction: out
239 - name: bb
240 direction: in
241 route_reflector_client: false
242 route_server_client: true
243 - neighbor: Eth1/2
244 address_family:
245 - afi: ipv4
246 safi: unicast
247 activate: true
248 allowas_in:
249 origin: true
250 route_map:
251 - name: aa
252 direction: out
253 - name: bb
254 direction: in
255 route_reflector_client: true
256 route_server_client: true
257 ip_afi:
258 default_policy_name: bb
259 send_default_route: true
260 prefix_limit:
261 max_prefixes: 100
262 prevent_teardown: true
263 warning_threshold: 80
264 prefix_list_in: p1
265 prefix_list_out: p2
266 - bgp_as: "{{ bgp_as2 }}"
267 vrf_name: "{{ vrf1 }}"
268 neighbors:
269 - neighbor: Eth1/11
270 address_family:
271 - afi: ipv4
272 safi: unicast
273 activate: true
274 allowas_in:
275 value: 6
276 route_map:
277 - name: aa
278 direction: out
279 - name: bb
280 direction: in
281 route_reflector_client: false
282 route_server_client: true
283 - afi: ipv6
284 safi: unicast
285 activate: true
286 allowas_in:
287 value: 6
288 route_map:
289 - name: aa
290 direction: out
291 - name: bb
292 direction: in
293 route_reflector_client: false
294 route_server_client: true
295 - neighbor: Eth1/12
296 address_family:
297 - afi: ipv4
298 safi: unicast
299 activate: true
300 allowas_in:
301 origin: true
302 route_map:
303 - name: aa
304 direction: out
305 - name: bb
306 direction: in
307 route_reflector_client: true
308 route_server_client: true
309 - afi: ipv6
310 safi: unicast
311 activate: true
312 allowas_in:
313 value: 2
314 route_map:
315 - name: aa
316 direction: out
317 - name: bb
318 direction: in
319 route_reflector_client: true
320 route_server_client: true
321 state: merged