Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_vlan_mapping_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_vlan_mapping_module:
2
3
4 *******************************************
5 dellemc.enterprise_sonic.sonic_vlan_mapping
6 *******************************************
7
8 **Configure vlan mappings on SONiC.**
9
10
11 Version added: 2.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides configuration management for vlan mappings on devices running SONiC.
21 - Vlan mappings only available on TD3 and TD4 devices.
22 - For TD4 devices must enable vlan mapping first (can enable in config-switch-resource).
23
24
25
26
27 Parameters
28 ----------
29
30 .. raw:: html
31
32 <table border=0 cellpadding=0 class="documentation-table">
33 <tr>
34 <th colspan="5">Parameter</th>
35 <th>Choices/<font color="blue">Defaults</font></th>
36 <th width="100%">Comments</th>
37 </tr>
38 <tr>
39 <td colspan="5">
40 <div class="ansibleOptionAnchor" id="parameter-"></div>
41 <b>config</b>
42 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
43 <div style="font-size: small">
44 <span style="color: purple">list</span>
45 / <span style="color: purple">elements=dictionary</span>
46 </div>
47 </td>
48 <td>
49 </td>
50 <td>
51 <div>Specifies the vlan mapping related configurations.</div>
52 </td>
53 </tr>
54 <tr>
55 <td class="elbow-placeholder"></td>
56 <td colspan="4">
57 <div class="ansibleOptionAnchor" id="parameter-"></div>
58 <b>mapping</b>
59 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
60 <div style="font-size: small">
61 <span style="color: purple">list</span>
62 / <span style="color: purple">elements=dictionary</span>
63 </div>
64 </td>
65 <td>
66 </td>
67 <td>
68 <div>Define vlan mappings.</div>
69 <div>dot1q_tunnel and vlan_translation are mutually exclusive.</div>
70 </td>
71 </tr>
72 <tr>
73 <td class="elbow-placeholder"></td>
74 <td class="elbow-placeholder"></td>
75 <td colspan="3">
76 <div class="ansibleOptionAnchor" id="parameter-"></div>
77 <b>dot1q_tunnel</b>
78 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
79 <div style="font-size: small">
80 <span style="color: purple">dictionary</span>
81 </div>
82 </td>
83 <td>
84 </td>
85 <td>
86 <div>Specify a vlan stacking.</div>
87 </td>
88 </tr>
89 <tr>
90 <td class="elbow-placeholder"></td>
91 <td class="elbow-placeholder"></td>
92 <td class="elbow-placeholder"></td>
93 <td colspan="2">
94 <div class="ansibleOptionAnchor" id="parameter-"></div>
95 <b>priority</b>
96 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
97 <div style="font-size: small">
98 <span style="color: purple">integer</span>
99 </div>
100 </td>
101 <td>
102 </td>
103 <td>
104 <div>Set priority level of the vlan stacking.</div>
105 <div>Priority range is 0-7.</div>
106 </td>
107 </tr>
108 <tr>
109 <td class="elbow-placeholder"></td>
110 <td class="elbow-placeholder"></td>
111 <td class="elbow-placeholder"></td>
112 <td colspan="2">
113 <div class="ansibleOptionAnchor" id="parameter-"></div>
114 <b>vlan_ids</b>
115 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
116 <div style="font-size: small">
117 <span style="color: purple">list</span>
118 / <span style="color: purple">elements=string</span>
119 </div>
120 </td>
121 <td>
122 </td>
123 <td>
124 <div>Configure customer VLAN IDs.</div>
125 <div>It can pass ranges and/or multiple list entries.</div>
126 <div>Individual VLAN ID or (-) separated range of VLAN IDs.</div>
127 </td>
128 </tr>
129
130 <tr>
131 <td class="elbow-placeholder"></td>
132 <td class="elbow-placeholder"></td>
133 <td colspan="3">
134 <div class="ansibleOptionAnchor" id="parameter-"></div>
135 <b>service_vlan</b>
136 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
137 <div style="font-size: small">
138 <span style="color: purple">integer</span>
139 / <span style="color: red">required</span>
140 </div>
141 </td>
142 <td>
143 </td>
144 <td>
145 <div>Configure service provider VLAN ID.</div>
146 <div>VLAN ID range is 1-4094.</div>
147 </td>
148 </tr>
149 <tr>
150 <td class="elbow-placeholder"></td>
151 <td class="elbow-placeholder"></td>
152 <td colspan="3">
153 <div class="ansibleOptionAnchor" id="parameter-"></div>
154 <b>vlan_translation</b>
155 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
156 <div style="font-size: small">
157 <span style="color: purple">dictionary</span>
158 </div>
159 <div style="font-style: italic; font-size: small; color: darkgreen">added in 3.0.0</div>
160 </td>
161 <td>
162 </td>
163 <td>
164 <div>Specify a vlan translation.</div>
165 </td>
166 </tr>
167 <tr>
168 <td class="elbow-placeholder"></td>
169 <td class="elbow-placeholder"></td>
170 <td class="elbow-placeholder"></td>
171 <td colspan="2">
172 <div class="ansibleOptionAnchor" id="parameter-"></div>
173 <b>match_double_tags</b>
174 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
175 <div style="font-size: small">
176 <span style="color: purple">list</span>
177 / <span style="color: purple">elements=dictionary</span>
178 </div>
179 </td>
180 <td>
181 </td>
182 <td>
183 <div>Configure double tagged vlan translation.</div>
184 </td>
185 </tr>
186 <tr>
187 <td class="elbow-placeholder"></td>
188 <td class="elbow-placeholder"></td>
189 <td class="elbow-placeholder"></td>
190 <td class="elbow-placeholder"></td>
191 <td colspan="1">
192 <div class="ansibleOptionAnchor" id="parameter-"></div>
193 <b>inner_vlan</b>
194 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
195 <div style="font-size: small">
196 <span style="color: purple">integer</span>
197 / <span style="color: red">required</span>
198 </div>
199 </td>
200 <td>
201 </td>
202 <td>
203 <div>Configure inner customer VLAN ID.</div>
204 <div>VLAN ID range is 1-4094.</div>
205 <div>Only available for double tagged translations.</div>
206 </td>
207 </tr>
208 <tr>
209 <td class="elbow-placeholder"></td>
210 <td class="elbow-placeholder"></td>
211 <td class="elbow-placeholder"></td>
212 <td class="elbow-placeholder"></td>
213 <td colspan="1">
214 <div class="ansibleOptionAnchor" id="parameter-"></div>
215 <b>outer_vlan</b>
216 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
217 <div style="font-size: small">
218 <span style="color: purple">integer</span>
219 / <span style="color: red">required</span>
220 </div>
221 </td>
222 <td>
223 </td>
224 <td>
225 <div>Configure outer customer VLAN ID.</div>
226 <div>VLAN ID range is 1-4094.</div>
227 </td>
228 </tr>
229 <tr>
230 <td class="elbow-placeholder"></td>
231 <td class="elbow-placeholder"></td>
232 <td class="elbow-placeholder"></td>
233 <td class="elbow-placeholder"></td>
234 <td colspan="1">
235 <div class="ansibleOptionAnchor" id="parameter-"></div>
236 <b>priority</b>
237 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
238 <div style="font-size: small">
239 <span style="color: purple">integer</span>
240 </div>
241 </td>
242 <td>
243 </td>
244 <td>
245 <div>Set priority level of the vlan translation.</div>
246 <div>Priority range is 0-7.</div>
247 </td>
248 </tr>
249
250 <tr>
251 <td class="elbow-placeholder"></td>
252 <td class="elbow-placeholder"></td>
253 <td class="elbow-placeholder"></td>
254 <td colspan="2">
255 <div class="ansibleOptionAnchor" id="parameter-"></div>
256 <b>match_single_tags</b>
257 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
258 <div style="font-size: small">
259 <span style="color: purple">list</span>
260 / <span style="color: purple">elements=dictionary</span>
261 </div>
262 </td>
263 <td>
264 </td>
265 <td>
266 <div>Configure single tagged vlan translation.</div>
267 </td>
268 </tr>
269 <tr>
270 <td class="elbow-placeholder"></td>
271 <td class="elbow-placeholder"></td>
272 <td class="elbow-placeholder"></td>
273 <td class="elbow-placeholder"></td>
274 <td colspan="1">
275 <div class="ansibleOptionAnchor" id="parameter-"></div>
276 <b>outer_vlan</b>
277 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
278 <div style="font-size: small">
279 <span style="color: purple">integer</span>
280 / <span style="color: red">required</span>
281 </div>
282 </td>
283 <td>
284 </td>
285 <td>
286 <div>Configure outer customer VLAN ID.</div>
287 <div>VLAN ID range is 1-4094.</div>
288 </td>
289 </tr>
290 <tr>
291 <td class="elbow-placeholder"></td>
292 <td class="elbow-placeholder"></td>
293 <td class="elbow-placeholder"></td>
294 <td class="elbow-placeholder"></td>
295 <td colspan="1">
296 <div class="ansibleOptionAnchor" id="parameter-"></div>
297 <b>priority</b>
298 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
299 <div style="font-size: small">
300 <span style="color: purple">integer</span>
301 </div>
302 </td>
303 <td>
304 </td>
305 <td>
306 <div>Set priority level of the vlan translation.</div>
307 <div>Priority range is 0-7.</div>
308 </td>
309 </tr>
310
311 <tr>
312 <td class="elbow-placeholder"></td>
313 <td class="elbow-placeholder"></td>
314 <td class="elbow-placeholder"></td>
315 <td colspan="2">
316 <div class="ansibleOptionAnchor" id="parameter-"></div>
317 <b>multi_tag</b>
318 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
319 <div style="font-size: small">
320 <span style="color: purple">boolean</span>
321 </div>
322 </td>
323 <td>
324 <ul style="margin: 0; padding: 0"><b>Choices:</b>
325 <li>no</li>
326 <li>yes</li>
327 </ul>
328 </td>
329 <td>
330 <div>Indicate if there are multiple tags.</div>
331 </td>
332 </tr>
333
334
335 <tr>
336 <td class="elbow-placeholder"></td>
337 <td colspan="4">
338 <div class="ansibleOptionAnchor" id="parameter-"></div>
339 <b>name</b>
340 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
341 <div style="font-size: small">
342 <span style="color: purple">string</span>
343 / <span style="color: red">required</span>
344 </div>
345 </td>
346 <td>
347 </td>
348 <td>
349 <div>Full name of the interface, i.e. Ethernet8, PortChannel2, Eth1/2.</div>
350 </td>
351 </tr>
352
353 <tr>
354 <td colspan="5">
355 <div class="ansibleOptionAnchor" id="parameter-"></div>
356 <b>state</b>
357 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
358 <div style="font-size: small">
359 <span style="color: purple">string</span>
360 </div>
361 </td>
362 <td>
363 <ul style="margin: 0; padding: 0"><b>Choices:</b>
364 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
365 <li>deleted</li>
366 <li>replaced</li>
367 <li>overridden</li>
368 </ul>
369 </td>
370 <td>
371 <div>Specifies the operation to be performed on the vlan mappings configured on the device.</div>
372 <div>In case of merged, the input configuration will be merged with the existing vlan mappings on the device.</div>
373 <div>In case of deleted, the existing vlan mapping configuration will be removed from the device.</div>
374 <div>In case of overridden, all existing vlan mappings will be deleted and the specified input configuration will be add.</div>
375 <div>In case of replaced, the existing vlan mappings on the device will be replaced by the configuration for each vlan mapping.</div>
376 </td>
377 </tr>
378 </table>
379 <br/>
380
381
382
383
384 Examples
385 --------
386
387 .. code-block:: yaml
388
389 #
390 # Using "deleted" state
391 #
392 # Before state:
393 # -------------
394 #
395 # sonic# show interface vlan-mappings dot1q-tunnel
396 # --------------------------------------------------------------------
397 # Name Vlan dot1q-tunnel Vlan Priority
398 # --------------------------------------------------------------------
399 # Ethernet4 360-366,392 2755 3
400 #
401 # - name: Delete dot1q_tunnel configuration
402 # sonic_vlan_mapping:
403 # config:
404 # - name: Ethernet4
405 # mapping:
406 # - service_vlan: 2755
407 # dot1q_tunnel:
408 # vlan_ids:
409 # - 392
410 # - 360-362
411 # state: deleted
412 #
413 # After state:
414 # ------------
415 #
416 # sonic# show interface vlan-mappings dot1q-tunnel
417 # --------------------------------------------------------------------
418 # Name Vlan dot1q-tunnel Vlan Priority
419 # --------------------------------------------------------------------
420 # Ethernet4 363-366 2755 3
421 #
422 # Using "deleted" state
423 #
424 # Before state:
425 # -------------
426 #
427 # sonic# show interface vlan-mappings
428 # Flags: M - Multi-tag
429 # ---------------------------------------------------------
430 # Name Outer Inner Mapped Vlan Priority Flags
431 # ---------------------------------------------------------
432 # Ethernet8 610 600 2567 - -
433 # Ethernet8 611 601 2567 1 -
434 # Ethernet8 612 602 2567 2 -
435 #
436 # - name: Delete vlan translation configuration
437 # sonic_vlan_mapping:
438 # config:
439 # - name: Ethernet8
440 # mapping:
441 # - service_vlan: 2567
442 # vlan_translation:
443 # match_double_tags:
444 # - inner_vlan: 602
445 # outer_vlan: 612
446 # priority: 2
447 # state: deleted
448 #
449 # After state:
450 # ------------
451 #
452 # sonic# show interface vlan-mappings
453 # Flags: M - Multi-tag
454 # ---------------------------------------------------------
455 # Name Outer Inner Mapped Vlan Priority Flags
456 # ---------------------------------------------------------
457 # Ethernet8 610 600 2567 - -
458 # Ethernet8 611 601 2567 1 -
459 #
460 #
461 # Using "merged" state
462 #
463 # Before state:
464 # -------------
465 #
466 # sonic# show interface vlan-mappings dot1q-tunnel
467 #
468 # - name: Merge dot1q_tunnel configuration
469 # sonic_vlan_mapping:
470 # config:
471 # - name: Ethernet4
472 # mapping:
473 # - service_vlan: 2755
474 # dot1q_tunnel:
475 # vlan_ids:
476 # - 392
477 # - 360-366
478 # priority: 3
479 # state: merged
480 #
481 # After state:
482 # ------------
483 #
484 # sonic# show interface vlan-mappings dot1q-tunnel
485 # --------------------------------------------------------------------
486 # Name Vlan dot1q-tunnel Vlan Priority
487 # --------------------------------------------------------------------
488 # Ethernet4 360-366,392 2755 3
489 #
490 # Using "merged" state
491 #
492 # Before state:
493 # -------------
494 #
495 # sonic# show interface vlan-mappings dot1q-tunnel
496 # --------------------------------------------------------------------
497 # Name Vlan dot1q-tunnel Vlan Priority
498 # --------------------------------------------------------------------
499 # Ethernet4 360-366,392 2755 3
500 #
501 # - name: Merge vlan translation configuration
502 # sonic_vlan_mapping:
503 # config:
504 # - name: Ethernet8
505 # mapping:
506 # - service_vlan: 2567
507 # vlan_translation:
508 # match_double_tags:
509 # - inner_vlan: 600
510 # outer_vlan: 610
511 # - inner_vlan: 601
512 # outer_vlan: 611
513 # priority: 1
514 # - inner_vlan: 602
515 # outer_vlan: 612
516 # priority: 2
517 # state: merged
518 #
519 # After state:
520 # ------------
521 #
522 # sonic# show interface vlan-mappings
523 # Flags: M - Multi-tag
524 # ---------------------------------------------------------
525 # Name Outer Inner Mapped Vlan Priority Flags
526 # ---------------------------------------------------------
527 # Ethernet8 610 600 2567 - -
528 # Ethernet8 611 601 2567 1 -
529 # Ethernet8 612 602 2567 2 -
530 #
531 # sonic# show interface vlan-mappings dot1q-tunnel
532 # --------------------------------------------------------------------
533 # Name Vlan dot1q-tunnel Vlan Priority
534 # --------------------------------------------------------------------
535 # Ethernet4 360-366,392 2755 3
536 #
537 #
538 # Using "replaced" state
539 #
540 # Before state:
541 # -------------
542 #
543 # sonic# show interface vlan-mappings dot1q-tunnel
544 # --------------------------------------------------------------------
545 # Name Vlan dot1q-tunnel Vlan Priority
546 # --------------------------------------------------------------------
547 # Ethernet4 360-366,392 2755 3
548 #
549 # - name: Replace dot1q_tunnel configuration
550 # sonic_vlan_mapping:
551 # config:
552 # - name: Ethernet4
553 # mapping:
554 # - service_vlan: 2755
555 # dot1q_tunnel:
556 # vlan_ids:
557 # - 660-666
558 # priority: 6
559 # state: replaced
560 #
561 # After state:
562 # ------------
563 #
564 # sonic# show interface vlan-mappings dot1q-tunnel
565 # --------------------------------------------------------------------
566 # Name Vlan dot1q-tunnel Vlan Priority
567 # --------------------------------------------------------------------
568 # Ethernet4 660-666 2755 6
569 #
570 # Using "overridden" state
571 #
572 # Before state:
573 # -------------
574 #
575 # sonic# show interface vlan-mappings
576 # Flags: M - Multi-tag
577 # ---------------------------------------------------------
578 # Name Outer Inner Mapped Vlan Priority Flags
579 # ---------------------------------------------------------
580 # Ethernet8 610 600 2567 - -
581 # Ethernet8 611 601 2567 1 -
582 # Ethernet8 612 602 2567 2 -
583 #
584 # - name: Override vlan translation configuration
585 # sonic_vlan_mapping:
586 # config:
587 # - name: Ethernet8
588 # mapping:
589 # - service_vlan: 2567
590 # vlan_translation:
591 # match_double_tags:
592 # - inner_vlan: 701
593 # outer_vlan: 711
594 # priority: 5
595 # - inner_vlan: 702
596 # outer_vlan: 712
597 # priority: 6
598 # state: overridden
599 #
600 # After state:
601 # ------------
602 #
603 # sonic# show interface vlan-mappings
604 # Flags: M - Multi-tag
605 # ---------------------------------------------------------
606 # Name Outer Inner Mapped Vlan Priority Flags
607 # ---------------------------------------------------------
608 # Ethernet8 711 701 2567 5 -
609 # Ethernet8 712 702 2567 6 -
610 #
611
612
613
614 Return Values
615 -------------
616 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:
617
618 .. raw:: html
619
620 <table border=0 cellpadding=0 class="documentation-table">
621 <tr>
622 <th colspan="1">Key</th>
623 <th>Returned</th>
624 <th width="100%">Description</th>
625 </tr>
626 <tr>
627 <td colspan="1">
628 <div class="ansibleOptionAnchor" id="return-"></div>
629 <b>after</b>
630 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
631 <div style="font-size: small">
632 <span style="color: purple">list</span>
633 </div>
634 </td>
635 <td>when changed</td>
636 <td>
637 <div>The resulting configuration module invocation.</div>
638 <br/>
639 <div style="font-size: smaller"><b>Sample:</b></div>
640 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format as the parameters above.</div>
641 </td>
642 </tr>
643 <tr>
644 <td colspan="1">
645 <div class="ansibleOptionAnchor" id="return-"></div>
646 <b>before</b>
647 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
648 <div style="font-size: small">
649 <span style="color: purple">list</span>
650 </div>
651 </td>
652 <td>always</td>
653 <td>
654 <div>The configuration prior to the module invocation.</div>
655 <br/>
656 <div style="font-size: smaller"><b>Sample:</b></div>
657 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format as the parameters above.</div>
658 </td>
659 </tr>
660 <tr>
661 <td colspan="1">
662 <div class="ansibleOptionAnchor" id="return-"></div>
663 <b>commands</b>
664 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
665 <div style="font-size: small">
666 <span style="color: purple">list</span>
667 </div>
668 </td>
669 <td>always</td>
670 <td>
671 <div>The set of commands pushed to the remote device.</div>
672 <br/>
673 <div style="font-size: smaller"><b>Sample:</b></div>
674 <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>
675 </td>
676 </tr>
677 </table>
678 <br/><br/>
679
680
681 Status
682 ------
683
684
685 Authors
686 ~~~~~~~
687
688 - Cypher Miller (@Cypher-Miller)