Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_l2_interfaces_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_l2_interfaces_module:
2
3
4 ********************************************
5 dellemc.enterprise_sonic.sonic_l2_interfaces
6 ********************************************
7
8 **Configure interface-to-VLAN association that is based on access or trunk mode**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - Manages Layer 2 interface attributes of 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 Layer 2 interface 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>access</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>Configures access mode characteristics of the 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>vlan</b>
74 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
75 <div style="font-size: small">
76 <span style="color: purple">integer</span>
77 </div>
78 </td>
79 <td>
80 </td>
81 <td>
82 <div>Configures the specified VLAN in access mode.</div>
83 </td>
84 </tr>
85
86 <tr>
87 <td class="elbow-placeholder"></td>
88 <td colspan="3">
89 <div class="ansibleOptionAnchor" id="parameter-"></div>
90 <b>name</b>
91 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
92 <div style="font-size: small">
93 <span style="color: purple">string</span>
94 / <span style="color: red">required</span>
95 </div>
96 </td>
97 <td>
98 </td>
99 <td>
100 <div>Full name of the interface, for example, &#x27;Eth1/26&#x27;.</div>
101 </td>
102 </tr>
103 <tr>
104 <td class="elbow-placeholder"></td>
105 <td colspan="3">
106 <div class="ansibleOptionAnchor" id="parameter-"></div>
107 <b>trunk</b>
108 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
109 <div style="font-size: small">
110 <span style="color: purple">dictionary</span>
111 </div>
112 </td>
113 <td>
114 </td>
115 <td>
116 <div>Configures trunking parameters on an interface.</div>
117 </td>
118 </tr>
119 <tr>
120 <td class="elbow-placeholder"></td>
121 <td class="elbow-placeholder"></td>
122 <td colspan="2">
123 <div class="ansibleOptionAnchor" id="parameter-"></div>
124 <b>allowed_vlans</b>
125 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
126 <div style="font-size: small">
127 <span style="color: purple">list</span>
128 / <span style="color: purple">elements=dictionary</span>
129 </div>
130 </td>
131 <td>
132 </td>
133 <td>
134 <div>Specifies a list of allowed trunk mode VLANs and VLAN ranges for the interface.</div>
135 </td>
136 </tr>
137 <tr>
138 <td class="elbow-placeholder"></td>
139 <td class="elbow-placeholder"></td>
140 <td class="elbow-placeholder"></td>
141 <td colspan="1">
142 <div class="ansibleOptionAnchor" id="parameter-"></div>
143 <b>vlan</b>
144 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
145 <div style="font-size: small">
146 <span style="color: purple">string</span>
147 </div>
148 </td>
149 <td>
150 </td>
151 <td>
152 <div>Configures the specified trunk mode VLAN or VLAN range.</div>
153 </td>
154 </tr>
155
156
157
158 <tr>
159 <td colspan="4">
160 <div class="ansibleOptionAnchor" id="parameter-"></div>
161 <b>state</b>
162 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
163 <div style="font-size: small">
164 <span style="color: purple">string</span>
165 </div>
166 </td>
167 <td>
168 <ul style="margin: 0; padding: 0"><b>Choices:</b>
169 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
170 <li>deleted</li>
171 <li>replaced</li>
172 <li>overridden</li>
173 </ul>
174 </td>
175 <td>
176 <div>The state that the configuration should be left in.</div>
177 </td>
178 </tr>
179 </table>
180 <br/>
181
182
183 Notes
184 -----
185
186 .. note::
187 - Tested against Enterprise SONiC Distribution by Dell Technologies.
188 - Supports ``check_mode``.
189
190
191
192 Examples
193 --------
194
195 .. code-block:: yaml
196
197 # Using "deleted" state
198 #
199 # Before state:
200 # -------------
201 #
202 # do show Vlan
203 # Q: A - Access (Untagged), T - Tagged
204 # NUM Status Q Ports
205 # 10 Inactive A Eth1/3
206 # 11 Inactive T Eth1/3
207 # 12 Inactive A Eth1/4
208 # 13 Inactive T Eth1/4
209 # 14 Inactive A Eth1/5
210 # 15 Inactive T Eth1/5
211 #
212 - name: Configures switch port of interfaces
213 dellemc.enterprise_sonic.sonic_l2_interfaces:
214 config:
215 - name: Eth1/3
216 - name: Eth1/4
217 state: deleted
218 #
219 # After state:
220 # ------------
221 #
222 # do show Vlan
223 # Q: A - Access (Untagged), T - Tagged
224 # NUM Status Q Ports
225 # 10 Inactive
226 # 11 Inactive
227 # 12 Inactive
228 # 13 Inactive
229 # 14 Inactive A Eth1/5
230 # 15 Inactive T Eth1/5
231 #
232 #
233 # Using "deleted" state
234 #
235 # Before state:
236 # -------------
237 #
238 # do show Vlan
239 # Q: A - Access (Untagged), T - Tagged
240 # NUM Status Q Ports
241 # 10 Inactive A Eth1/3
242 # 11 Inactive T Eth1/3
243 # 12 Inactive A Eth1/4
244 # 13 Inactive T Eth1/4
245 # 14 Inactive A Eth1/5
246 # 15 Inactive T Eth1/5
247 #
248 - name: Configures switch port of interfaces
249 dellemc.enterprise_sonic.sonic_l2_interfaces:
250 config:
251 state: deleted
252 #
253 # After state:
254 # do show Vlan
255 # Q: A - Access (Untagged), T - Tagged
256 # NUM Status Q Ports
257 # 10 Inactive
258 # 11 Inactive
259 # 12 Inactive
260 # 13 Inactive
261 # 14 Inactive
262 # 15 Inactive
263 #
264 #
265 # Using "deleted" state
266 #
267 # Before state:
268 # -------------
269 #
270 # do show Vlan
271 # Q: A - Access (Untagged), T - Tagged
272 # NUM Status Q Ports
273 # 11 Inactive T Ethernet12
274 # 12 Inactive A Ethernet12
275 # 13 Inactive T Ethernet12
276 # 14 Inactive T Ethernet12
277 # 15 Inactive T Ethernet12
278 # 16 Inactive T Ethernet12
279
280 - name: Delete the access vlan and a range of trunk vlans for an interface
281 sonic_l2_interfaces:
282 config:
283 - name: Ethernet12
284 access:
285 vlan: 12
286 trunk:
287 allowed_vlans:
288 - vlan: 13-16
289 state: deleted
290
291 # After state:
292 # ------------
293 #
294 # do show Vlan
295 # Q: A - Access (Untagged), T - Tagged
296 # NUM Status Q Ports
297 # 11 Inactive T Ethernet12
298 # 12 Inactive
299 # 13 Inactive
300 # 14 Inactive
301 # 15 Inactive
302 # 16 Inactive
303 #
304 #
305 #
306 # Using "merged" state
307 #
308 # Before state:
309 # -------------
310 #
311 # do show Vlan
312 # Q: A - Access (Untagged), T - Tagged
313 # NUM Status Q Ports
314 # 10 Inactive
315 # 11 Inactive T Eth1/7
316 # 12 Inactive T Eth1/7
317 #
318 - name: Configures an access vlan for an interface
319 dellemc.enterprise_sonic.sonic_l2_interfaces:
320 config:
321 - name: Eth1/3
322 access:
323 vlan: 10
324 state: merged
325 #
326 # After state:
327 # ------------
328 #
329 # do show Vlan
330 # Q: A - Access (Untagged), T - Tagged
331 # NUM Status Q Ports
332 # 10 Inactive A Eth1/3
333 # 11 Inactive T Eth1/7
334 # 12 Inactive T Eth1/7
335 #
336 #
337 # Using "merged" state
338 #
339 # Before state:
340 # -------------
341 #
342 # do show Vlan
343 # Q: A - Access (Untagged), T - Tagged
344 # NUM Status Q Ports
345 # 10 Inactive A Eth1/3
346 # 12 Inactive
347 # 13 Inactive
348 # 14 Inactive
349 # 15 Inactive
350 # 16 Inactive
351 # 18 Inactive
352 #
353 - name: Modify the access vlan, add a range of trunk vlans and a single trunk vlan for an interface
354 dellemc.enterprise_sonic.sonic_l2_interfaces:
355 config:
356 - name: Eth1/3
357 access:
358 vlan: 12
359 trunk:
360 allowed_vlans:
361 - vlan: 13-16
362 - vlan: 18
363 state: merged
364 #
365 # After state:
366 # ------------
367 #
368 # do show Vlan
369 # Q: A - Access (Untagged), T - Tagged
370 # NUM Status Q Ports
371 # 10 Inactive
372 # 12 Inactive A Eth1/3
373 # 13 Inactive T Eth1/3
374 # 14 Inactive T Eth1/3
375 # 15 Inactive T Eth1/3
376 # 16 Inactive T Eth1/3
377 # 18 Inactive T Eth1/3
378 #
379 #
380 # Using "merged" state
381 #
382 # Before state:
383 # -------------
384 #
385 # do show Vlan
386 # Q: A - Access (Untagged), T - Tagged
387 # NUM Status Q Ports
388 # 10 Inactive
389 # 11 Inactive
390 # 12 Inactive A Eth1/4
391 # 13 Inactive T Eth1/4
392 # 14 Inactive A Eth1/5
393 # 15 Inactive T Eth1/5
394 #
395 - name: Configures switch port of interfaces
396 dellemc.enterprise_sonic.sonic_l2_interfaces:
397 config:
398 - name: Eth1/3
399 access:
400 vlan: 12
401 trunk:
402 allowed_vlans:
403 - vlan: 13
404 - vlan: 14
405 state: merged
406 #
407 # After state:
408 # ------------
409 #
410 # do show Vlan
411 # Q: A - Access (Untagged), T - Tagged
412 # NUM Status Q Ports
413 # 10 Inactive
414 # 11 Inactive
415 # 12 Inactive A Eth1/3
416 # A Eth1/4
417 # 13 Inactive T Eth1/3
418 # T Eth1/4
419 # 14 Inactive A Eth1/3
420 # A Eth1/5
421 # 15 Inactive T Eth1/5
422 #
423 #
424 # Using "replaced" state
425 #
426 # Before state:
427 # -------------
428 #
429 # do show Vlan
430 # Q: A - Access (Untagged), T - Tagged
431 # NUM Status Q Ports
432 # 10 Inactive A Ethernet12
433 # A Ethernet13
434 # 11 Inactive T Ethernet12
435 # T Ethernet13
436
437 - name: Replace access vlan and trunk vlans for specified interfaces
438 sonic_l2_interfaces:
439 config:
440 - name: Ethernet12
441 access:
442 vlan: 12
443 trunk:
444 allowed_vlans:
445 - vlan: 13-14
446 - name: Ethernet14
447 access:
448 vlan: 10
449 trunk:
450 allowed_vlans:
451 - vlan: 11
452 - vlan: 13-14
453 state: replaced
454
455 # After state:
456 # ------------
457 #
458 # do show Vlan
459 # Q: A - Access (Untagged), T - Tagged
460 # NUM Status Q Ports
461 # 10 Inactive A Ethernet13
462 # A Ethernet14
463 # 11 Inactive T Ethernet13
464 # T Ethernet14
465 # 12 Inactive A Ethernet12
466 # 13 Inactive T Ethernet12
467 # T Ethernet14
468 # 14 Inactive T Ethernet12
469 # T Ethernet14
470 #
471 #
472 # Using "overridden" state
473 #
474 # Before state:
475 # -------------
476 #
477 # do show Vlan
478 # Q: A - Access (Untagged), T - Tagged
479 # NUM Status Q Ports
480 # 10 Inactive A Ethernet11
481 # 11 Inactive T Ethernet11
482 # 12 Inactive A Ethernet12
483 # 13 Inactive T Ethernet12
484
485 - name: Override L2 interfaces configuration in device with provided configuration
486 sonic_l2_interfaces:
487 config:
488 - name: Ethernet13
489 access:
490 vlan: 12
491 trunk:
492 allowed_vlans:
493 - vlan: 13-14
494 state: overridden
495
496 # After state:
497 # ------------
498 #
499 # do show Vlan
500 # Q: A - Access (Untagged), T - Tagged
501 # NUM Status Q Ports
502 # 12 Inactive A Ethernet13
503 # 13 Inactive T Ethernet13
504 # 14 Inactive T Ethernet13
505 #
506 #
507
508
509
510 Return Values
511 -------------
512 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:
513
514 .. raw:: html
515
516 <table border=0 cellpadding=0 class="documentation-table">
517 <tr>
518 <th colspan="1">Key</th>
519 <th>Returned</th>
520 <th width="100%">Description</th>
521 </tr>
522 <tr>
523 <td colspan="1">
524 <div class="ansibleOptionAnchor" id="return-"></div>
525 <b>after</b>
526 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
527 <div style="font-size: small">
528 <span style="color: purple">list</span>
529 </div>
530 </td>
531 <td>when changed</td>
532 <td>
533 <div>The resulting configuration module invocation.</div>
534 <br/>
535 <div style="font-size: smaller"><b>Sample:</b></div>
536 <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>
537 </td>
538 </tr>
539 <tr>
540 <td colspan="1">
541 <div class="ansibleOptionAnchor" id="return-"></div>
542 <b>before</b>
543 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
544 <div style="font-size: small">
545 <span style="color: purple">list</span>
546 </div>
547 </td>
548 <td>always</td>
549 <td>
550 <div>The configuration prior to the module invocation.</div>
551 <br/>
552 <div style="font-size: smaller"><b>Sample:</b></div>
553 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned always in the same format as the parameters above.</div>
554 </td>
555 </tr>
556 <tr>
557 <td colspan="1">
558 <div class="ansibleOptionAnchor" id="return-"></div>
559 <b>commands</b>
560 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
561 <div style="font-size: small">
562 <span style="color: purple">list</span>
563 </div>
564 </td>
565 <td>always</td>
566 <td>
567 <div>The set of commands pushed to the remote device.</div>
568 <br/>
569 <div style="font-size: smaller"><b>Sample:</b></div>
570 <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>
571 </td>
572 </tr>
573 </table>
574 <br/><br/>
575
576
577 Status
578 ------
579
580
581 Authors
582 ~~~~~~~
583
584 - Niraimadaiselvam M(@niraimadaiselvamm)