Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_vlans_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_vlans_module:
2
3
4 ************************************
5 dellemc.enterprise_sonic.sonic_vlans
6 ************************************
7
8 **Manage VLAN and its parameters**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides configuration management of VLANs parameters on devices running 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="2">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="2">
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 dictionary of VLAN options.</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="1">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>autostate</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">boolean</span>
60 </div>
61 <div style="font-style: italic; font-size: small; color: darkgreen">added in 3.1.0</div>
62 </td>
63 <td>
64 <ul style="margin: 0; padding: 0"><b>Choices:</b>
65 <li>no</li>
66 <li>yes</li>
67 </ul>
68 </td>
69 <td>
70 <div>Enable or disable autostate functionality for the VLAN interface.</div>
71 <div>Default value for this field if not configured yet will be &quot;enable&quot; which is equivalent to true.</div>
72 </td>
73 </tr>
74 <tr>
75 <td class="elbow-placeholder"></td>
76 <td colspan="1">
77 <div class="ansibleOptionAnchor" id="parameter-"></div>
78 <b>description</b>
79 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
80 <div style="font-size: small">
81 <span style="color: purple">string</span>
82 </div>
83 </td>
84 <td>
85 </td>
86 <td>
87 <div>Description about the VLAN.</div>
88 </td>
89 </tr>
90 <tr>
91 <td class="elbow-placeholder"></td>
92 <td colspan="1">
93 <div class="ansibleOptionAnchor" id="parameter-"></div>
94 <b>vlan_id</b>
95 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
96 <div style="font-size: small">
97 <span style="color: purple">integer</span>
98 / <span style="color: red">required</span>
99 </div>
100 </td>
101 <td>
102 </td>
103 <td>
104 <div>ID of the VLAN</div>
105 <div>Range is 1 to 4094</div>
106 </td>
107 </tr>
108
109 <tr>
110 <td colspan="2">
111 <div class="ansibleOptionAnchor" id="parameter-"></div>
112 <b>state</b>
113 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
114 <div style="font-size: small">
115 <span style="color: purple">string</span>
116 </div>
117 </td>
118 <td>
119 <ul style="margin: 0; padding: 0"><b>Choices:</b>
120 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
121 <li>replaced</li>
122 <li>overridden</li>
123 <li>deleted</li>
124 </ul>
125 </td>
126 <td>
127 <div>The state that the configuration should be left in.</div>
128 </td>
129 </tr>
130 </table>
131 <br/>
132
133
134 Notes
135 -----
136
137 .. note::
138 - Tested against Enterprise SONiC Distribution by Dell Technologies.
139 - Supports ``check_mode``.
140
141
142
143 Examples
144 --------
145
146 .. code-block:: yaml
147
148 # Using "merged" state
149
150 # Before state:
151 # -------------
152 #
153 # sonic# show Vlan
154 # Q: A - Access (Untagged), T - Tagged
155 # NUM Status Q Ports
156 # 10 Inactive
157 # 30 Inactive
158 #
159 # sonic#
160 #
161
162
163 - name: Merges given VLAN attributes with the device configuration
164 dellemc.enterprise_sonic.sonic_vlans:
165 config:
166 - vlan_id: 10
167 description: "Internal"
168 state: merged
169
170 # After state:
171 # ------------
172 #
173 # sonic# show Vlan
174 # Q: A - Access (Untagged), T - Tagged
175 # NUM Status Q Ports
176 # 10 Inactive
177 # 30 Inactive
178 #
179 # sonic#
180 #
181 # sonic# show interface Vlan 10
182 # Description: Internal
183 # Vlan10 is up
184 # Mode of IPV4 address assignment: not-set
185 # Mode of IPV6 address assignment: not-set
186 # IP MTU 6000 bytes
187 # sonic#
188 #
189
190 # Using "replaced" state
191
192 # Before state:
193 # -------------
194 #
195 # sonic# show Vlan
196 # Q: A - Access (Untagged), T - Tagged
197 # NUM Status Q Ports
198 # 10 Inactive
199 # 30 Inactive
200 #
201 # sonic#
202
203 - name: Replace all attributes of specified VLANs with provided configuration
204 dellemc.enterprise_sonic.sonic_vlans:
205 config:
206 - vlan_id: 10
207 state: replaced
208
209 # After state:
210 # ------------
211 #
212 # sonic# show Vlan
213 # Q: A - Access (Untagged), T - Tagged
214 # NUM Status Q Ports
215 # 10 Inactive
216 # 30 Inactive
217 #
218 # sonic#
219
220 # Using "overridden" state
221
222 # Before state:
223 # -------------
224 #
225 # sonic# show Vlan
226 # Q: A - Access (Untagged), T - Tagged
227 # NUM Status Q Ports
228 # 10 Inactive
229 # 30 Inactive
230 #
231 # sonic#
232
233 - name: Override device configuration of all VLANs with provided configuration
234 dellemc.enterprise_sonic.sonic_vlans:
235 config:
236 - vlan_id: 10
237 state: overridden
238
239 # After state:
240 # ------------
241 #
242 # sonic# show Vlan
243 # Q: A - Access (Untagged), T - Tagged
244 # NUM Status Q Ports
245 # 10 Inactive
246 #
247 # sonic#
248
249 # Using "deleted" state
250
251 # Before state:
252 # -------------
253 #
254 # sonic# show interface Vlan 70
255 # Description: Internal
256 # Vlan70 is up
257 # Mode of IPV4 address assignment: not-set
258 # Mode of IPV6 address assignment: not-set
259 # IP MTU 6000 bytes
260
261 - name: Deletes attributes of the given VLANs
262 dellemc.enterprise_sonic.sonic_vlans:
263 config:
264 - vlan_id: 70
265 description: "Internal"
266 state: deleted
267
268 # After state:
269 # ------------
270 #
271 # sonic# show interface Vlan 70
272 # Vlan70 is up
273 # Mode of IPV4 address assignment: not-set
274 # Mode of IPV6 address assignment: not-set
275 # IP MTU 6000 bytes
276
277 # Before state:
278 # -------------
279 #
280 # sonic# show Vlan
281 # Q: A - Access (Untagged), T - Tagged
282 # NUM Status Q Ports
283 # 10 Inactive
284 # 20 Inactive
285 #
286 # sonic#
287
288 - name: Deletes attributes of the given VLANs
289 dellemc.enterprise_sonic.sonic_vlans:
290 config:
291 - vlan_id: 20
292 state: deleted
293
294 # After state:
295 # ------------
296 #
297 # sonic# show Vlan
298 # Q: A - Access (Untagged), T - Tagged
299 # NUM Status Q Ports
300 # 10 Inactive
301 #
302 # sonic#
303
304
305 # Using "deleted" state
306
307 # Before state:
308 # -------------
309 #
310 # sonic# show Vlan
311 # Q: A - Access (Untagged), T - Tagged
312 # NUM Status Q Ports
313 # 10 Inactive
314 # 20 Inactive
315 # 30 Inactive
316 #
317 # sonic#
318
319 - name: Deletes all the VLANs on the switch
320 dellemc.enterprise_sonic.sonic_vlans:
321 config:
322 state: deleted
323
324 # After state:
325 # ------------
326 #
327 # sonic# show Vlan
328 # Q: A - Access (Untagged), T - Tagged
329 # NUM Status Q Ports
330 #
331 # sonic#
332
333
334
335 Return Values
336 -------------
337 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:
338
339 .. raw:: html
340
341 <table border=0 cellpadding=0 class="documentation-table">
342 <tr>
343 <th colspan="1">Key</th>
344 <th>Returned</th>
345 <th width="100%">Description</th>
346 </tr>
347 <tr>
348 <td colspan="1">
349 <div class="ansibleOptionAnchor" id="return-"></div>
350 <b>after</b>
351 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
352 <div style="font-size: small">
353 <span style="color: purple">list</span>
354 </div>
355 </td>
356 <td>when changed</td>
357 <td>
358 <div>The resulting configuration module invocation.</div>
359 <br/>
360 <div style="font-size: smaller"><b>Sample:</b></div>
361 <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>
362 </td>
363 </tr>
364 <tr>
365 <td colspan="1">
366 <div class="ansibleOptionAnchor" id="return-"></div>
367 <b>before</b>
368 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
369 <div style="font-size: small">
370 <span style="color: purple">list</span>
371 </div>
372 </td>
373 <td>always</td>
374 <td>
375 <div>The configuration prior to the module invocation.</div>
376 <br/>
377 <div style="font-size: smaller"><b>Sample:</b></div>
378 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration that is returned is always in the same format as the parameters above.</div>
379 </td>
380 </tr>
381 <tr>
382 <td colspan="1">
383 <div class="ansibleOptionAnchor" id="return-"></div>
384 <b>commands</b>
385 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
386 <div style="font-size: small">
387 <span style="color: purple">list</span>
388 </div>
389 </td>
390 <td>always</td>
391 <td>
392 <div>The set of commands pushed to the remote device.</div>
393 <br/>
394 <div style="font-size: smaller"><b>Sample:</b></div>
395 <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>
396 </td>
397 </tr>
398 </table>
399 <br/><br/>
400
401
402 Status
403 ------
404
405
406 Authors
407 ~~~~~~~
408
409 - Mohamed Javeed (@javeedf)