Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_pki_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_pki_module:
2
3
4 **********************************
5 dellemc.enterprise_sonic.sonic_pki
6 **********************************
7
8 **Manages PKI attributes of Enterprise Sonic**
9
10
11 Version added: 2.3.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - Manages PKI attributes of Enterprise 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">dictionary</span>
43 </div>
44 </td>
45 <td>
46 </td>
47 <td>
48 <div>The provided configuration</div>
49 </td>
50 </tr>
51 <tr>
52 <td class="elbow-placeholder"></td>
53 <td colspan="2">
54 <div class="ansibleOptionAnchor" id="parameter-"></div>
55 <b>security_profiles</b>
56 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
57 <div style="font-size: small">
58 <span style="color: purple">list</span>
59 / <span style="color: purple">elements=dictionary</span>
60 </div>
61 </td>
62 <td>
63 </td>
64 <td>
65 <div>Application Security Profiles</div>
66 </td>
67 </tr>
68 <tr>
69 <td class="elbow-placeholder"></td>
70 <td class="elbow-placeholder"></td>
71 <td colspan="1">
72 <div class="ansibleOptionAnchor" id="parameter-"></div>
73 <b>cdp_list</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=string</span>
78 </div>
79 </td>
80 <td>
81 </td>
82 <td>
83 <div>Global list of CDP&#x27;s</div>
84 </td>
85 </tr>
86 <tr>
87 <td class="elbow-placeholder"></td>
88 <td class="elbow-placeholder"></td>
89 <td colspan="1">
90 <div class="ansibleOptionAnchor" id="parameter-"></div>
91 <b>certificate_name</b>
92 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
93 <div style="font-size: small">
94 <span style="color: purple">string</span>
95 </div>
96 </td>
97 <td>
98 </td>
99 <td>
100 <div>Host Certificate Name</div>
101 </td>
102 </tr>
103 <tr>
104 <td class="elbow-placeholder"></td>
105 <td class="elbow-placeholder"></td>
106 <td colspan="1">
107 <div class="ansibleOptionAnchor" id="parameter-"></div>
108 <b>key_usage_check</b>
109 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
110 <div style="font-size: small">
111 <span style="color: purple">boolean</span>
112 </div>
113 </td>
114 <td>
115 <ul style="margin: 0; padding: 0"><b>Choices:</b>
116 <li>no</li>
117 <li>yes</li>
118 </ul>
119 </td>
120 <td>
121 <div>Require key usage is enforced</div>
122 </td>
123 </tr>
124 <tr>
125 <td class="elbow-placeholder"></td>
126 <td class="elbow-placeholder"></td>
127 <td colspan="1">
128 <div class="ansibleOptionAnchor" id="parameter-"></div>
129 <b>ocsp_responder_list</b>
130 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
131 <div style="font-size: small">
132 <span style="color: purple">list</span>
133 / <span style="color: purple">elements=string</span>
134 </div>
135 </td>
136 <td>
137 </td>
138 <td>
139 <div>Global list of OCSP responders</div>
140 </td>
141 </tr>
142 <tr>
143 <td class="elbow-placeholder"></td>
144 <td class="elbow-placeholder"></td>
145 <td colspan="1">
146 <div class="ansibleOptionAnchor" id="parameter-"></div>
147 <b>peer_name_check</b>
148 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
149 <div style="font-size: small">
150 <span style="color: purple">boolean</span>
151 </div>
152 </td>
153 <td>
154 <ul style="margin: 0; padding: 0"><b>Choices:</b>
155 <li>no</li>
156 <li>yes</li>
157 </ul>
158 </td>
159 <td>
160 <div>Require peer name is verified</div>
161 </td>
162 </tr>
163 <tr>
164 <td class="elbow-placeholder"></td>
165 <td class="elbow-placeholder"></td>
166 <td colspan="1">
167 <div class="ansibleOptionAnchor" id="parameter-"></div>
168 <b>profile_name</b>
169 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
170 <div style="font-size: small">
171 <span style="color: purple">string</span>
172 / <span style="color: red">required</span>
173 </div>
174 </td>
175 <td>
176 </td>
177 <td>
178 <div>Profile Name</div>
179 </td>
180 </tr>
181 <tr>
182 <td class="elbow-placeholder"></td>
183 <td class="elbow-placeholder"></td>
184 <td colspan="1">
185 <div class="ansibleOptionAnchor" id="parameter-"></div>
186 <b>revocation_check</b>
187 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
188 <div style="font-size: small">
189 <span style="color: purple">boolean</span>
190 </div>
191 </td>
192 <td>
193 <ul style="margin: 0; padding: 0"><b>Choices:</b>
194 <li>no</li>
195 <li>yes</li>
196 </ul>
197 </td>
198 <td>
199 <div>Require certificate revocation check succeeds</div>
200 </td>
201 </tr>
202 <tr>
203 <td class="elbow-placeholder"></td>
204 <td class="elbow-placeholder"></td>
205 <td colspan="1">
206 <div class="ansibleOptionAnchor" id="parameter-"></div>
207 <b>trust_store</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 </td>
215 <td>
216 <div>Name of associated trust_store</div>
217 </td>
218 </tr>
219
220 <tr>
221 <td class="elbow-placeholder"></td>
222 <td colspan="2">
223 <div class="ansibleOptionAnchor" id="parameter-"></div>
224 <b>trust_stores</b>
225 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
226 <div style="font-size: small">
227 <span style="color: purple">list</span>
228 / <span style="color: purple">elements=dictionary</span>
229 </div>
230 </td>
231 <td>
232 </td>
233 <td>
234 <div>Store of CA Certificates</div>
235 </td>
236 </tr>
237 <tr>
238 <td class="elbow-placeholder"></td>
239 <td class="elbow-placeholder"></td>
240 <td colspan="1">
241 <div class="ansibleOptionAnchor" id="parameter-"></div>
242 <b>ca_name</b>
243 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
244 <div style="font-size: small">
245 <span style="color: purple">list</span>
246 / <span style="color: purple">elements=string</span>
247 </div>
248 </td>
249 <td>
250 </td>
251 <td>
252 <div>List of CA certificates in the trust store.</div>
253 </td>
254 </tr>
255 <tr>
256 <td class="elbow-placeholder"></td>
257 <td class="elbow-placeholder"></td>
258 <td colspan="1">
259 <div class="ansibleOptionAnchor" id="parameter-"></div>
260 <b>name</b>
261 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
262 <div style="font-size: small">
263 <span style="color: purple">string</span>
264 / <span style="color: red">required</span>
265 </div>
266 </td>
267 <td>
268 </td>
269 <td>
270 <div>The name of the Trust Store</div>
271 </td>
272 </tr>
273
274
275 <tr>
276 <td colspan="3">
277 <div class="ansibleOptionAnchor" id="parameter-"></div>
278 <b>state</b>
279 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
280 <div style="font-size: small">
281 <span style="color: purple">string</span>
282 </div>
283 </td>
284 <td>
285 <ul style="margin: 0; padding: 0"><b>Choices:</b>
286 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
287 <li>deleted</li>
288 <li>replaced</li>
289 <li>overridden</li>
290 </ul>
291 </td>
292 <td>
293 <div>The state of the configuration after module completion.</div>
294 </td>
295 </tr>
296 </table>
297 <br/>
298
299
300 Notes
301 -----
302
303 .. note::
304 - Tested against Dell Enterprise SONiC 4.1.0
305
306
307
308 Examples
309 --------
310
311 .. code-block:: yaml
312
313 # Using "merged" state for initial config
314 #
315 # Before state:
316 # -------------
317 #
318 # sonic# show running-configuration | grep crypto
319 # sonic#
320 #
321 - name: "Initial Config"
322 dellemc.enterprise_sonic.sonic_pki:
323 config:
324 security_profiles:
325 - profile_name: rest
326 ocsp_responder_list:
327 - http://example.com/ocspa
328 - http://example.com/ocspb
329 certificate_name: host
330 trust_store: default-ts
331 trust_stores:
332 - name: default-ts
333 ca_name:
334 - CA2
335 state: merged
336
337 # After state:
338 # ------------
339 #
340 # sonic# show running-configuration | grep crypto
341 # crypto trust_store default-ts ca-cert CA2
342 # crypto security-profile rest
343 # crypto security-profile trust_store rest default-ts
344 # crypto security-profile certificate rest host
345 # crypto security-profile ocsp-list rest http://example.com/ocspa,http://example.com/ocspb
346
347 # Using "deleted" state to remove configuration
348 #
349 # Before state:
350 # ------------
351 #
352 # sonic# show running-configuration | grep crypto
353 # crypto trust_store default-ts ca-cert CA2
354 # crypto security-profile rest
355 # crypto security-profile trust_store rest default-ts
356 # crypto security-profile certificate rest host
357 # crypto security-profile ocsp-list rest http://example.com/ocsp
358 #
359 - name: PKI Delete Test
360 hosts: datacenter
361 gather_facts: true
362 connection: httpapi
363 tasks:
364 - name: Remove trust_store from security-profile
365 dellemc.enterprise_sonic.sonic_pki:
366 config:
367 security_profiles:
368 - profile_name: rest
369 trust_store: default-ts
370 state: deleted
371 # After state:
372 # ------------
373 #
374 # sonic# show running-configuration | grep crypto
375 # crypto trust_store default-ts ca-cert CA2
376 # crypto security-profile rest
377 # crypto security-profile certificate rest host
378 # crypto security-profile ocsp-list rest http://example.com/ocsp
379
380 # Using "overridden" state
381
382 # Before state:
383 # ------------
384 #
385 # sonic# show running-configuration | grep crypto
386 # crypto trust_store default-ts ca-cert CA2
387 # crypto security-profile rest
388 # crypto security-profile trust_store rest default-ts
389 # crypto security-profile certificate rest host
390 # crypto security-profile ocsp-list rest http://example.com/ocspa,http://example.com/ocspb
391 #
392 - name: "Overridden Config"
393 dellemc.enterprise_sonic.sonic_pki:
394 config:
395 security_profiles:
396 - profile_name: telemetry
397 ocsp_responder_list:
398 - http://example.com/ocspb
399 revocation_check: true
400 trust_store: telemetry-ts
401 certificate_name: host
402 trust_stores:
403 - name: telemetry-ts
404 ca_name: CA
405 state: overridden
406 # After state:
407 # -----------
408 #
409 # sonic# show running-configuration | grep crypto
410 # crypto trust_store telemetry-ts ca-cert CA
411 # crypto security-profile telemetry revocation_check true
412 # crypto security-profile trust_store telemetry telemetry-ts
413 # crypto security-profile certificate telemetry host
414 # crypto security-profile ocsp-list telemetry http://example.com/ocspb
415
416 # Using "replaced" state to update config
417
418 # Before state:
419 # ------------
420 #
421 # sonic# show running-configuration | grep crypto
422 # crypto trust_store default-ts ca-cert CA2
423 # crypto security-profile rest
424 # crypto security-profile trust_store rest default-ts
425 # crypto security-profile certificate rest host
426 # crypto security-profile ocsp-list rest http://example.com/ocspa,http://example.com/ocspb
427 #
428 - name: "Replace Config"
429 dellemc.enterprise_sonic.sonic_pki:
430 config:
431 security_profiles:
432 - profile_name: rest
433 ocsp_responder_list:
434 - http://example.com/ocsp
435 revocation_check: false
436 trust_store: default-ts
437 certificate_name: host
438 state: replaced
439 # After state:
440 # -----------
441 #
442 # sonic# show running-configuration | grep crypto
443 # crypto trust_store default-ts ca-cert CA2
444 # crypto security-profile rest
445 # crypto security-profile trust_store rest default-ts
446 # crypto security-profile certificate rest host
447 # crypto security-profile ocsp-list rest http://example.com/ocsp
448
449
450
451 Return Values
452 -------------
453 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:
454
455 .. raw:: html
456
457 <table border=0 cellpadding=0 class="documentation-table">
458 <tr>
459 <th colspan="1">Key</th>
460 <th>Returned</th>
461 <th width="100%">Description</th>
462 </tr>
463 <tr>
464 <td colspan="1">
465 <div class="ansibleOptionAnchor" id="return-"></div>
466 <b>after</b>
467 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
468 <div style="font-size: small">
469 <span style="color: purple">dictionary</span>
470 </div>
471 </td>
472 <td>when changed</td>
473 <td>
474 <div>The resulting configuration module invocation.</div>
475 <br/>
476 <div style="font-size: smaller"><b>Sample:</b></div>
477 <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>
478 </td>
479 </tr>
480 <tr>
481 <td colspan="1">
482 <div class="ansibleOptionAnchor" id="return-"></div>
483 <b>before</b>
484 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
485 <div style="font-size: small">
486 <span style="color: purple">dictionary</span>
487 </div>
488 </td>
489 <td>always</td>
490 <td>
491 <div>The configuration prior to the module invocation.</div>
492 <br/>
493 <div style="font-size: smaller"><b>Sample:</b></div>
494 <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>
495 </td>
496 </tr>
497 <tr>
498 <td colspan="1">
499 <div class="ansibleOptionAnchor" id="return-"></div>
500 <b>commands</b>
501 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
502 <div style="font-size: small">
503 <span style="color: purple">list</span>
504 </div>
505 </td>
506 <td>always</td>
507 <td>
508 <div>The set of commands pushed to the remote device.</div>
509 <br/>
510 <div style="font-size: smaller"><b>Sample:</b></div>
511 <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>
512 </td>
513 </tr>
514 </table>
515 <br/><br/>
516
517
518 Status
519 ------
520
521
522 Authors
523 ~~~~~~~
524
525 - Eric Seifert (@seiferteric)