Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_network_policy_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_network_policy_module:
2
3
4 *********************************************
5 dellemc.enterprise_sonic.sonic_network_policy
6 *********************************************
7
8 **Manage network policy configuration on SONiC**
9
10
11 Version added: 3.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides configuration management of network policy for devices running SONiC
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="3">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="3">
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>List of network policy configurations</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="2">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>applications</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">list</span>
60 / <span style="color: purple">elements=dictionary</span>
61 </div>
62 </td>
63 <td>
64 </td>
65 <td>
66 <div>List of network policy application configurations</div>
67 <div><em>dot1p</em> and <em>vlan_id</em> are mutually exclusive</div>
68 <div><em>dot1p</em> cannot be configured when <em>untagged=True</em></div>
69 </td>
70 </tr>
71 <tr>
72 <td class="elbow-placeholder"></td>
73 <td class="elbow-placeholder"></td>
74 <td colspan="1">
75 <div class="ansibleOptionAnchor" id="parameter-"></div>
76 <b>app_type</b>
77 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
78 <div style="font-size: small">
79 <span style="color: purple">string</span>
80 / <span style="color: red">required</span>
81 </div>
82 </td>
83 <td>
84 <ul style="margin: 0; padding: 0"><b>Choices:</b>
85 <li>voice</li>
86 <li>voice-signaling</li>
87 </ul>
88 </td>
89 <td>
90 <div>Media type of the application</div>
91 </td>
92 </tr>
93 <tr>
94 <td class="elbow-placeholder"></td>
95 <td class="elbow-placeholder"></td>
96 <td colspan="1">
97 <div class="ansibleOptionAnchor" id="parameter-"></div>
98 <b>dot1p</b>
99 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
100 <div style="font-size: small">
101 <span style="color: purple">string</span>
102 </div>
103 </td>
104 <td>
105 <ul style="margin: 0; padding: 0"><b>Choices:</b>
106 <li>enabled</li>
107 </ul>
108 </td>
109 <td>
110 <div>Enable dot1p priority tagging</div>
111 </td>
112 </tr>
113 <tr>
114 <td class="elbow-placeholder"></td>
115 <td class="elbow-placeholder"></td>
116 <td colspan="1">
117 <div class="ansibleOptionAnchor" id="parameter-"></div>
118 <b>dscp</b>
119 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
120 <div style="font-size: small">
121 <span style="color: purple">integer</span>
122 </div>
123 </td>
124 <td>
125 </td>
126 <td>
127 <div>DSCP value of VLAN, range 0-63</div>
128 </td>
129 </tr>
130 <tr>
131 <td class="elbow-placeholder"></td>
132 <td class="elbow-placeholder"></td>
133 <td colspan="1">
134 <div class="ansibleOptionAnchor" id="parameter-"></div>
135 <b>priority</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 </div>
140 </td>
141 <td>
142 </td>
143 <td>
144 <div>Priority of VLAN, range 0-7</div>
145 </td>
146 </tr>
147 <tr>
148 <td class="elbow-placeholder"></td>
149 <td class="elbow-placeholder"></td>
150 <td colspan="1">
151 <div class="ansibleOptionAnchor" id="parameter-"></div>
152 <b>untagged</b>
153 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
154 <div style="font-size: small">
155 <span style="color: purple">boolean</span>
156 </div>
157 </td>
158 <td>
159 <ul style="margin: 0; padding: 0"><b>Choices:</b>
160 <li>no</li>
161 <li>yes</li>
162 </ul>
163 </td>
164 <td>
165 <div>Indicates that the application is using an untagged VLAN</div>
166 </td>
167 </tr>
168 <tr>
169 <td class="elbow-placeholder"></td>
170 <td class="elbow-placeholder"></td>
171 <td colspan="1">
172 <div class="ansibleOptionAnchor" id="parameter-"></div>
173 <b>vlan_id</b>
174 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
175 <div style="font-size: small">
176 <span style="color: purple">integer</span>
177 </div>
178 </td>
179 <td>
180 </td>
181 <td>
182 <div>VLAN identifier, range 1-4094</div>
183 </td>
184 </tr>
185
186 <tr>
187 <td class="elbow-placeholder"></td>
188 <td colspan="2">
189 <div class="ansibleOptionAnchor" id="parameter-"></div>
190 <b>number</b>
191 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
192 <div style="font-size: small">
193 <span style="color: purple">integer</span>
194 / <span style="color: red">required</span>
195 </div>
196 </td>
197 <td>
198 </td>
199 <td>
200 <div>Network policy number, range 1-128</div>
201 </td>
202 </tr>
203
204 <tr>
205 <td colspan="3">
206 <div class="ansibleOptionAnchor" id="parameter-"></div>
207 <b>state</b>
208 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
209 <div style="font-size: small">
210 <span style="color: purple">string</span>
211 </div>
212 </td>
213 <td>
214 <ul style="margin: 0; padding: 0"><b>Choices:</b>
215 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
216 <li>deleted</li>
217 <li>replaced</li>
218 <li>overridden</li>
219 </ul>
220 </td>
221 <td>
222 <div>The state of the configuration after module completion</div>
223 </td>
224 </tr>
225 </table>
226 <br/>
227
228
229 Notes
230 -----
231
232 .. note::
233 - Tested against Enterprise SONiC Distribution by Dell Technologies.
234 - Supports ``check_mode``.
235
236
237
238 Examples
239 --------
240
241 .. code-block:: yaml
242
243 # Using "merged" state
244 #
245 # Before state:
246 # -------------
247 #
248 # sonic# show running-configuration
249 # (No network policy configuration present)
250
251 - name: Merge network policy configuration
252 dellemc.enterprise_sonic.sonic_network_policy:
253 config:
254 - number: 1
255 applications:
256 - app_type: voice
257 vlan_id: 2
258 priority: 1
259 dscp: 1
260 - app_type: voice-signaling
261 dot1p: enabled
262 dscp: 50
263 state: merged
264
265 # After state:
266 # ------------
267 #
268 # sonic# show running-configuration
269 # !
270 # network-policy profile 1
271 # voice vlan 2 cos 1 dscp 1
272 # voice-signaling vlan dot1p dscp 50
273 # !
274
275
276 # Using "replaced" state
277 #
278 # Before state:
279 # -------------
280 #
281 # sonic# show running-configuration
282 # !
283 # network-policy profile 1
284 # voice vlan 2 cos 1 dscp 1
285 # voice-signaling vlan 3 untagged dscp 50
286 # !
287 # network-policy profile 2
288 # voice vlan 100 cos 7 dscp 12
289 # voice-signaling vlan 400 cos 7 dscp 45
290 # !
291
292 - name: Replace network policy configuration
293 dellemc.enterprise_sonic.sonic_network_policy:
294 config:
295 - number: 1
296 applications:
297 - app_type: voice
298 vlan_id: 1
299 untagged: false
300 priority: 0
301 dscp: 0
302 state: replaced
303
304 # After state:
305 # ------------
306 #
307 # sonic# show running-configuration
308 # !
309 # network-policy profile 1
310 # voice vlan 1 cos 0 dscp 0
311 # !
312 # network-policy profile 2
313 # voice vlan 100 cos 7 dscp 12
314 # voice-signaling vlan 400 cos 7 dscp 45
315 # !
316
317
318 # Using "overridden" state
319 #
320 # Before state:
321 # -------------
322 #
323 # sonic# show running-configuration
324 # !
325 # network-policy profile 1
326 # voice vlan 2 cos 1 dscp 1
327 # voice-signaling vlan 3 untagged dscp 50
328 # !
329 # network-policy profile 2
330 # voice vlan 100 cos 7 dscp 12
331 # voice-signaling vlan 400 cos 7 dscp 45
332 # !
333
334 - name: Override network policy configuration
335 dellemc.enterprise_sonic.sonic_network_policy:
336 config:
337 - number: 1
338 applications:
339 - app_type: voice
340 vlan_id: 1
341 untagged: false
342 priority: 0
343 dscp: 0
344 state: overridden
345
346 # After state:
347 # ------------
348 #
349 # sonic# show running-configuration
350 # !
351 # network-policy profile 1
352 # voice vlan 1 cos 0 dscp 0
353 # !
354
355
356 # Using "deleted" state
357 #
358 # Before state:
359 # -------------
360 #
361 # sonic# show running-configuration
362 # !
363 # network-policy profile 1
364 # voice vlan 2 cos 1 dscp 1
365 # voice-signaling vlan 3 untagged dscp 50
366 # !
367 # network-policy profile 2
368 # voice vlan 100 cos 7 dscp 12
369 # voice-signaling vlan 400 cos 7 dscp 45
370 # !
371 # network-policy profile 3
372 # voice-signaling vlan 80 cos 6 dscp 32
373 # !
374
375 - name: Delete network policy configuration
376 dellemc.enterprise_sonic.sonic_network_policy:
377 config:
378 - number: 1
379 applications:
380 - app_type: voice
381 dscp: 1
382 - number: 2
383 applications:
384 - app_type: voice
385 - number: 3
386 state: deleted
387
388 # After state:
389 # ------------
390 #
391 # sonic# show running-configuration
392 # !
393 # network-policy profile 1
394 # voice vlan 2 cos 1
395 # voice-signaling vlan 3 untagged dscp 50
396 # !
397 # network-policy profile 2
398 # voice-signaling vlan 400 cos 7 dscp 45
399 # !
400
401
402 # Using "deleted" state
403 #
404 # Before state:
405 # -------------
406 #
407 # sonic# show running-configuration
408 # !
409 # network-policy profile 1
410 # voice vlan 2 cos 1 dscp 1
411 # voice-signaling vlan 3 untagged dscp 50
412 # !
413 # network-policy profile 2
414 # voice vlan 100 cos 7 dscp 12
415 # voice-signaling vlan 400 cos 7 dscp 45
416 # !
417 # network-policy profile 3
418 # voice-signaling vlan 80 cos 6 dscp 32
419 # !
420
421 - name: Delete all network policy configuration
422 dellemc.enterprise_sonic.sonic_network_policy:
423 config:
424 state: deleted
425
426 # After state:
427 # ------------
428 #
429 # sonic# show running-configuration
430 # (No network policy configuration present)
431
432
433
434 Return Values
435 -------------
436 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:
437
438 .. raw:: html
439
440 <table border=0 cellpadding=0 class="documentation-table">
441 <tr>
442 <th colspan="1">Key</th>
443 <th>Returned</th>
444 <th width="100%">Description</th>
445 </tr>
446 <tr>
447 <td colspan="1">
448 <div class="ansibleOptionAnchor" id="return-"></div>
449 <b>after</b>
450 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
451 <div style="font-size: small">
452 <span style="color: purple">list</span>
453 </div>
454 </td>
455 <td>when changed</td>
456 <td>
457 <div>The configuration resulting from module invocation.</div>
458 <br/>
459 </td>
460 </tr>
461 <tr>
462 <td colspan="1">
463 <div class="ansibleOptionAnchor" id="return-"></div>
464 <b>after_generated</b>
465 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
466 <div style="font-size: small">
467 <span style="color: purple">list</span>
468 </div>
469 </td>
470 <td>when <code>check_mode</code></td>
471 <td>
472 <div>The generated configuration from module invocation.</div>
473 <br/>
474 </td>
475 </tr>
476 <tr>
477 <td colspan="1">
478 <div class="ansibleOptionAnchor" id="return-"></div>
479 <b>before</b>
480 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
481 <div style="font-size: small">
482 <span style="color: purple">list</span>
483 </div>
484 </td>
485 <td>always</td>
486 <td>
487 <div>The configuration prior to the module invocation.</div>
488 <br/>
489 </td>
490 </tr>
491 <tr>
492 <td colspan="1">
493 <div class="ansibleOptionAnchor" id="return-"></div>
494 <b>commands</b>
495 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
496 <div style="font-size: small">
497 <span style="color: purple">list</span>
498 </div>
499 </td>
500 <td>always</td>
501 <td>
502 <div>The set of commands pushed to the remote device.</div>
503 <br/>
504 <div style="font-size: smaller"><b>Sample:</b></div>
505 <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>
506 </td>
507 </tr>
508 </table>
509 <br/><br/>
510
511
512 Status
513 ------
514
515
516 Authors
517 ~~~~~~~
518
519 - S\. Talabi (@stalabi1)