Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_vrfs_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_vrfs_module:
2
3
4 ***********************************
5 dellemc.enterprise_sonic.sonic_vrfs
6 ***********************************
7
8 **Manage VRFs and associate VRFs to interfaces such as, Eth, LAG, VLAN, and loopback**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - Manages VRF and VRF interface attributes in Enterprise SONiC Distribution by Dell Technologies.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="4">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="4">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">list</span>
43 / <span style="color: purple">elements=dictionary</span>
44 </div>
45 </td>
46 <td>
47 </td>
48 <td>
49 <div>A list of VRF configurations.</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="3">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>members</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">dictionary</span>
60 </div>
61 </td>
62 <td>
63 </td>
64 <td>
65 <div>Holds a dictionary mapping of list of interfaces linked to a VRF interface.</div>
66 </td>
67 </tr>
68 <tr>
69 <td class="elbow-placeholder"></td>
70 <td class="elbow-placeholder"></td>
71 <td colspan="2">
72 <div class="ansibleOptionAnchor" id="parameter-"></div>
73 <b>interfaces</b>
74 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
75 <div style="font-size: small">
76 <span style="color: purple">list</span>
77 / <span style="color: purple">elements=dictionary</span>
78 </div>
79 </td>
80 <td>
81 </td>
82 <td>
83 <div>List of interface names that are linked to a specific VRF interface.</div>
84 </td>
85 </tr>
86 <tr>
87 <td class="elbow-placeholder"></td>
88 <td class="elbow-placeholder"></td>
89 <td class="elbow-placeholder"></td>
90 <td colspan="1">
91 <div class="ansibleOptionAnchor" id="parameter-"></div>
92 <b>name</b>
93 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
94 <div style="font-size: small">
95 <span style="color: purple">string</span>
96 </div>
97 </td>
98 <td>
99 </td>
100 <td>
101 <div>The name of the physical interface.</div>
102 </td>
103 </tr>
104
105
106 <tr>
107 <td class="elbow-placeholder"></td>
108 <td colspan="3">
109 <div class="ansibleOptionAnchor" id="parameter-"></div>
110 <b>name</b>
111 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
112 <div style="font-size: small">
113 <span style="color: purple">string</span>
114 / <span style="color: red">required</span>
115 </div>
116 </td>
117 <td>
118 </td>
119 <td>
120 <div>The name of the VRF interface.</div>
121 </td>
122 </tr>
123
124 <tr>
125 <td colspan="4">
126 <div class="ansibleOptionAnchor" id="parameter-"></div>
127 <b>state</b>
128 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
129 <div style="font-size: small">
130 <span style="color: purple">string</span>
131 </div>
132 </td>
133 <td>
134 <ul style="margin: 0; padding: 0"><b>Choices:</b>
135 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
136 <li>replaced</li>
137 <li>overridden</li>
138 <li>deleted</li>
139 </ul>
140 </td>
141 <td>
142 <div>The state of the configuration after module completion.</div>
143 </td>
144 </tr>
145 </table>
146 <br/>
147
148
149 Notes
150 -----
151
152 .. note::
153 - Tested against Enterprise SONiC Distribution by Dell Technologies.
154 - Supports ``check_mode``.
155 - This module does not support the deletion of mgmt VRF. Deletion of mgmt VRF can be done using the "sonic_config" resource module as shown in "playbooks/common_examples/mgmt_vrf_off.yaml". It can also be done using the SONiC CLI or by using a standalone REST API.
156
157
158
159 Examples
160 --------
161
162 .. code-block:: yaml
163
164 # Using "deleted" state
165 #
166 # Before state:
167 # -------------
168 #
169 # show ip vrf
170 # VRF-NAME INTERFACES
171 # ----------------------------------------------------------------
172 # Vrfcheck1
173 # Vrfcheck2
174 # Vrfcheck3 Eth1/3
175 # Eth1/14
176 # Eth1/16
177 # Eth1/17
178 # Vrfcheck4 Eth1/5
179 # Eth1/6
180 #
181 - name: Configuring vrf deleted state
182 dellemc.enterprise_sonic.sonic_vrfs:
183 config:
184 - name: Vrfcheck4
185 members:
186 interfaces:
187 - name: Eth1/6
188 - name: Vrfcheck3
189 members:
190 interfaces:
191 - name: Eth1/3
192 - name: Eth1/14
193 state: deleted
194 #
195 # After state:
196 # ------------
197 #
198 # show ip vrf
199 # VRF-NAME INTERFACES
200 # ----------------------------------------------------------------
201 # Vrfcheck1
202 # Vrfcheck2
203 # Vrfcheck3 Eth1/16
204 # Eth1/17
205 # Vrfcheck4 Eth1/5
206 #
207 #
208 # Using "merged" state
209 #
210 # Before state:
211 # -------------
212 #
213 # show ip vrf
214 # VRF-NAME INTERFACES
215 # ----------------------------------------------------------------
216 # Vrfcheck1
217 # Vrfcheck2
218 # Vrfcheck3 Eth1/16
219 # Eth1/17
220 # Vrfcheck4
221 #
222 - name: Configuring vrf merged state
223 dellemc.enterprise_sonic.sonic_vrfs:
224 config:
225 - name: Vrfcheck4
226 members:
227 interfaces:
228 - name: Eth1/5
229 - name: Eth1/6
230 - name: Vrfcheck3
231 members:
232 interfaces:
233 - name: Eth1/3
234 - name: Eth1/14
235 state: merged
236 #
237 # After state:
238 # ------------
239 #
240 # show ip vrf
241 # VRF-NAME INTERFACES
242 # ----------------------------------------------------------------
243 # Vrfcheck1
244 # Vrfcheck2
245 # Vrfcheck3 Eth1/3
246 # Eth1/14
247 # Eth1/16
248 # Eth1/17
249 # Vrfcheck4 Eth1/5
250 # Eth1/6
251 #
252 # Using "overridden" state
253 #
254 # Before state:
255 # -------------
256 #
257 # show ip vrf
258 # VRF-NAME INTERFACES
259 # ----------------------------------------------------------------
260 # Vrfcheck1
261 # Vrfcheck2
262 # Vrfcheck3 Eth1/7
263 # Eth1/8
264 #
265 - name: Overridden VRF configuration
266 dellemc.enterprise_sonic.sonic_vrfs:
267 sonic_vrfs:
268 config:
269 - name: Vrfcheck1
270 members:
271 interfaces:
272 - name: Eth1/3
273 - name: Eth1/14
274 - name: Vrfcheck3
275 members:
276 interfaces:
277 - name: Eth1/5
278 - name: Eth1/6
279 state: overridden
280 #
281 # After state:
282 # ------------
283 #
284 # show ip vrf
285 # VRF-NAME INTERFACES
286 # ----------------------------------------------------------------
287 # Vrfcheck1 Eth1/3
288 # Eth1/14
289 # Vrfcheck2
290 # Vrfcheck3 Eth1/5
291 # Eth1/6
292 #
293 # Using "replaced" state
294 #
295 # Before state:
296 # -------------
297 #
298 # show ip vrf
299 # VRF-NAME INTERFACES
300 # ----------------------------------------------------------------
301 # Vrfcheck1 Eth1/3
302 # Vrfcheck2
303 # Vrfcheck3 Eth1/5
304 # Eth1/6
305 #
306 - name: Replace VRF configuration
307 dellemc.enterprise_sonic.sonic_vrfs:
308 sonic_vrfs:
309 config:
310 - name: Vrfcheck1
311 members:
312 interfaces:
313 - name: Eth1/3
314 - name: Eth1/14
315 - name: Vrfcheck3
316 members:
317 interfaces:
318 - name: Eth1/5
319 - name: Eth1/6
320 state: replaced
321 #
322 # After state:
323 # ------------
324 #
325 # show ip vrf
326 # VRF-NAME INTERFACES
327 # ----------------------------------------------------------------
328 # Vrfcheck1 Eth1/3
329 # Eth1/14
330 # Vrfcheck2
331 # Vrfcheck3 Eth1/5
332 # Eth1/6
333 #
334
335
336
337 Return Values
338 -------------
339 Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
340
341 .. raw:: html
342
343 <table border=0 cellpadding=0 class="documentation-table">
344 <tr>
345 <th colspan="1">Key</th>
346 <th>Returned</th>
347 <th width="100%">Description</th>
348 </tr>
349 <tr>
350 <td colspan="1">
351 <div class="ansibleOptionAnchor" id="return-"></div>
352 <b>after</b>
353 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
354 <div style="font-size: small">
355 <span style="color: purple">list</span>
356 </div>
357 </td>
358 <td>when changed</td>
359 <td>
360 <div>The resulting configuration module invocation.</div>
361 <br/>
362 <div style="font-size: smaller"><b>Sample:</b></div>
363 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned is always in the same format as the parameters above.</div>
364 </td>
365 </tr>
366 <tr>
367 <td colspan="1">
368 <div class="ansibleOptionAnchor" id="return-"></div>
369 <b>before</b>
370 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
371 <div style="font-size: small">
372 <span style="color: purple">list</span>
373 </div>
374 </td>
375 <td>always</td>
376 <td>
377 <div>The configuration prior to the module invocation.</div>
378 <br/>
379 <div style="font-size: smaller"><b>Sample:</b></div>
380 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned is always in the same format as the parameters above.</div>
381 </td>
382 </tr>
383 <tr>
384 <td colspan="1">
385 <div class="ansibleOptionAnchor" id="return-"></div>
386 <b>commands</b>
387 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
388 <div style="font-size: small">
389 <span style="color: purple">list</span>
390 </div>
391 </td>
392 <td>always</td>
393 <td>
394 <div>The set of commands pushed to the remote device.</div>
395 <br/>
396 <div style="font-size: smaller"><b>Sample:</b></div>
397 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;command 1&#x27;, &#x27;command 2&#x27;, &#x27;command 3&#x27;]</div>
398 </td>
399 </tr>
400 </table>
401 <br/><br/>
402
403
404 Status
405 ------
406
407
408 Authors
409 ~~~~~~~
410
411 - Abirami N (@abirami-n)