Debian Codegraph @

ansible_collections/kubernetes/core/docs/kubernetes.core.helm_template_module.rst

raw
1 .. _kubernetes.core.helm_template_module:
2
3
4 *****************************
5 kubernetes.core.helm_template
6 *****************************
7
8 **Render chart templates**
9
10
11
12 .. contents::
13 :local:
14 :depth: 1
15
16
17 Synopsis
18 --------
19 - Render chart templates to an output directory or as text of concatenated yaml documents.
20
21
22
23 Requirements
24 ------------
25 The below requirements are needed on the host that executes this module.
26
27 - helm >= 3.0.0 (https://github.com/helm/helm/releases)
28 - yaml (https://pypi.org/project/PyYAML/)
29
30
31 Parameters
32 ----------
33
34 .. raw:: html
35
36 <table border=0 cellpadding=0 class="documentation-table">
37 <tr>
38 <th colspan="2">Parameter</th>
39 <th>Choices/<font color="blue">Defaults</font></th>
40 <th width="100%">Comments</th>
41 </tr>
42 <tr>
43 <td colspan="2">
44 <div class="ansibleOptionAnchor" id="parameter-"></div>
45 <b>binary_path</b>
46 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
47 <div style="font-size: small">
48 <span style="color: purple">path</span>
49 </div>
50 </td>
51 <td>
52 </td>
53 <td>
54 <div>The path of a helm binary to use.</div>
55 </td>
56 </tr>
57 <tr>
58 <td colspan="2">
59 <div class="ansibleOptionAnchor" id="parameter-"></div>
60 <b>chart_ref</b>
61 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
62 <div style="font-size: small">
63 <span style="color: purple">path</span>
64 / <span style="color: red">required</span>
65 </div>
66 </td>
67 <td>
68 </td>
69 <td>
70 <div>Chart reference with repo prefix, for example, <code>nginx-stable/nginx-ingress</code>.</div>
71 <div>Path to a packaged chart.</div>
72 <div>Path to an unpacked chart directory.</div>
73 <div>Absolute URL.</div>
74 </td>
75 </tr>
76 <tr>
77 <td colspan="2">
78 <div class="ansibleOptionAnchor" id="parameter-"></div>
79 <b>chart_repo_url</b>
80 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
81 <div style="font-size: small">
82 <span style="color: purple">string</span>
83 </div>
84 </td>
85 <td>
86 </td>
87 <td>
88 <div>Chart repository URL where the requested chart is located.</div>
89 </td>
90 </tr>
91 <tr>
92 <td colspan="2">
93 <div class="ansibleOptionAnchor" id="parameter-"></div>
94 <b>chart_version</b>
95 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
96 <div style="font-size: small">
97 <span style="color: purple">string</span>
98 </div>
99 </td>
100 <td>
101 </td>
102 <td>
103 <div>Chart version to use. If this is not specified, the latest version is installed.</div>
104 </td>
105 </tr>
106 <tr>
107 <td colspan="2">
108 <div class="ansibleOptionAnchor" id="parameter-"></div>
109 <b>dependency_update</b>
110 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
111 <div style="font-size: small">
112 <span style="color: purple">boolean</span>
113 </div>
114 <div style="font-style: italic; font-size: small; color: darkgreen">added in 2.4.0</div>
115 </td>
116 <td>
117 <ul style="margin: 0; padding: 0"><b>Choices:</b>
118 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
119 <li>yes</li>
120 </ul>
121 </td>
122 <td>
123 <div>Run helm dependency update before the operation.</div>
124 <div>The <em>dependency_update</em> option require the add of <code>dependencies</code> block in <code>Chart.yaml/requirements.yaml</code> file.</div>
125 <div>For more information please visit <a href='https://helm.sh/docs/helm/helm_dependency/'>https://helm.sh/docs/helm/helm_dependency/</a></div>
126 <div style="font-size: small; color: darkgreen"><br/>aliases: dep_up</div>
127 </td>
128 </tr>
129 <tr>
130 <td colspan="2">
131 <div class="ansibleOptionAnchor" id="parameter-"></div>
132 <b>disable_hook</b>
133 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
134 <div style="font-size: small">
135 <span style="color: purple">boolean</span>
136 </div>
137 <div style="font-style: italic; font-size: small; color: darkgreen">added in 2.4.0</div>
138 </td>
139 <td>
140 <ul style="margin: 0; padding: 0"><b>Choices:</b>
141 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
142 <li>yes</li>
143 </ul>
144 </td>
145 <td>
146 <div>Prevent hooks from running during install.</div>
147 </td>
148 </tr>
149 <tr>
150 <td colspan="2">
151 <div class="ansibleOptionAnchor" id="parameter-"></div>
152 <b>include_crds</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><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
161 <li>yes</li>
162 </ul>
163 </td>
164 <td>
165 <div>Include custom resource descriptions in rendered templates.</div>
166 </td>
167 </tr>
168 <tr>
169 <td colspan="2">
170 <div class="ansibleOptionAnchor" id="parameter-"></div>
171 <b>insecure_registry</b>
172 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
173 <div style="font-size: small">
174 <span style="color: purple">boolean</span>
175 </div>
176 <div style="font-style: italic; font-size: small; color: darkgreen">added in 5.1.0</div>
177 </td>
178 <td>
179 <ul style="margin: 0; padding: 0"><b>Choices:</b>
180 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
181 <li>yes</li>
182 </ul>
183 </td>
184 <td>
185 <div>Skip TLS certificate checks for the chart download</div>
186 </td>
187 </tr>
188 <tr>
189 <td colspan="2">
190 <div class="ansibleOptionAnchor" id="parameter-"></div>
191 <b>output_dir</b>
192 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
193 <div style="font-size: small">
194 <span style="color: purple">path</span>
195 </div>
196 </td>
197 <td>
198 </td>
199 <td>
200 <div>Output directory where templates will be written.</div>
201 <div>If the directory already exists, it will be overwritten.</div>
202 </td>
203 </tr>
204 <tr>
205 <td colspan="2">
206 <div class="ansibleOptionAnchor" id="parameter-"></div>
207 <b>plain_http</b>
208 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
209 <div style="font-size: small">
210 <span style="color: purple">boolean</span>
211 </div>
212 <div style="font-style: italic; font-size: small; color: darkgreen">added in 6.1.0</div>
213 </td>
214 <td>
215 <ul style="margin: 0; padding: 0"><b>Choices:</b>
216 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
217 <li>yes</li>
218 </ul>
219 </td>
220 <td>
221 <div>Use HTTP instead of HTTPS when working with OCI registries</div>
222 <div>Requires Helm &gt;= 3.13.0</div>
223 </td>
224 </tr>
225 <tr>
226 <td colspan="2">
227 <div class="ansibleOptionAnchor" id="parameter-"></div>
228 <b>release_name</b>
229 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
230 <div style="font-size: small">
231 <span style="color: purple">string</span>
232 </div>
233 <div style="font-style: italic; font-size: small; color: darkgreen">added in 2.4.0</div>
234 </td>
235 <td>
236 </td>
237 <td>
238 <div>Release name to use in rendered templates.</div>
239 <div style="font-size: small; color: darkgreen"><br/>aliases: name</div>
240 </td>
241 </tr>
242 <tr>
243 <td colspan="2">
244 <div class="ansibleOptionAnchor" id="parameter-"></div>
245 <b>release_namespace</b>
246 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
247 <div style="font-size: small">
248 <span style="color: purple">string</span>
249 </div>
250 <div style="font-style: italic; font-size: small; color: darkgreen">added in 2.4.0</div>
251 </td>
252 <td>
253 </td>
254 <td>
255 <div>namespace scope for this request.</div>
256 </td>
257 </tr>
258 <tr>
259 <td colspan="2">
260 <div class="ansibleOptionAnchor" id="parameter-"></div>
261 <b>release_values</b>
262 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
263 <div style="font-size: small">
264 <span style="color: purple">dictionary</span>
265 </div>
266 </td>
267 <td>
268 <b>Default:</b><br/><div style="color: blue">{}</div>
269 </td>
270 <td>
271 <div>Values to pass to chart.</div>
272 <div style="font-size: small; color: darkgreen"><br/>aliases: values</div>
273 </td>
274 </tr>
275 <tr>
276 <td colspan="2">
277 <div class="ansibleOptionAnchor" id="parameter-"></div>
278 <b>set_values</b>
279 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
280 <div style="font-size: small">
281 <span style="color: purple">list</span>
282 / <span style="color: purple">elements=dictionary</span>
283 </div>
284 <div style="font-style: italic; font-size: small; color: darkgreen">added in 2.4.0</div>
285 </td>
286 <td>
287 </td>
288 <td>
289 <div>Values to pass to chart configuration.</div>
290 </td>
291 </tr>
292 <tr>
293 <td class="elbow-placeholder"></td>
294 <td colspan="1">
295 <div class="ansibleOptionAnchor" id="parameter-"></div>
296 <b>value</b>
297 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
298 <div style="font-size: small">
299 <span style="color: purple">string</span>
300 / <span style="color: red">required</span>
301 </div>
302 </td>
303 <td>
304 </td>
305 <td>
306 <div>Value to pass to chart configuration (e.g phase=prod).</div>
307 </td>
308 </tr>
309 <tr>
310 <td class="elbow-placeholder"></td>
311 <td colspan="1">
312 <div class="ansibleOptionAnchor" id="parameter-"></div>
313 <b>value_type</b>
314 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
315 <div style="font-size: small">
316 <span style="color: purple">-</span>
317 </div>
318 </td>
319 <td>
320 <ul style="margin: 0; padding: 0"><b>Choices:</b>
321 <li><div style="color: blue"><b>raw</b>&nbsp;&larr;</div></li>
322 <li>string</li>
323 <li>json</li>
324 <li>file</li>
325 </ul>
326 </td>
327 <td>
328 <div>Use <code>raw</code> set individual value.</div>
329 <div>Use <code>string</code> to force a string for an individual value.</div>
330 <div>Use <code>file</code> to set individual values from a file when the value itself is too long for the command line or is dynamically generated.</div>
331 <div>Use <code>json</code> to set json values (scalars/objects/arrays). This feature requires helm&gt;=3.10.0.</div>
332 </td>
333 </tr>
334
335 <tr>
336 <td colspan="2">
337 <div class="ansibleOptionAnchor" id="parameter-"></div>
338 <b>show_only</b>
339 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
340 <div style="font-size: small">
341 <span style="color: purple">list</span>
342 / <span style="color: purple">elements=string</span>
343 </div>
344 <div style="font-style: italic; font-size: small; color: darkgreen">added in 2.4.0</div>
345 </td>
346 <td>
347 <b>Default:</b><br/><div style="color: blue">[]</div>
348 </td>
349 <td>
350 <div>Only show manifests rendered from the given templates.</div>
351 </td>
352 </tr>
353 <tr>
354 <td colspan="2">
355 <div class="ansibleOptionAnchor" id="parameter-"></div>
356 <b>update_repo_cache</b>
357 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
358 <div style="font-size: small">
359 <span style="color: purple">boolean</span>
360 </div>
361 </td>
362 <td>
363 <ul style="margin: 0; padding: 0"><b>Choices:</b>
364 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
365 <li>yes</li>
366 </ul>
367 </td>
368 <td>
369 <div>Run <code>helm repo update</code> before the operation. Can be run as part of the template generation or as a separate step.</div>
370 </td>
371 </tr>
372 <tr>
373 <td colspan="2">
374 <div class="ansibleOptionAnchor" id="parameter-"></div>
375 <b>values_files</b>
376 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
377 <div style="font-size: small">
378 <span style="color: purple">list</span>
379 / <span style="color: purple">elements=string</span>
380 </div>
381 </td>
382 <td>
383 <b>Default:</b><br/><div style="color: blue">[]</div>
384 </td>
385 <td>
386 <div>Value files to pass to chart.</div>
387 <div>Paths will be read from the target host&#x27;s filesystem, not the host running ansible.</div>
388 <div><em>values_files</em> option is evaluated before <em>values</em> option if both are used.</div>
389 <div>Paths are evaluated in the order the paths are specified.</div>
390 </td>
391 </tr>
392 </table>
393 <br/>
394
395
396
397
398 Examples
399 --------
400
401 .. code-block:: yaml
402
403 - name: Render templates to specified directory
404 kubernetes.core.helm_template:
405 chart_ref: stable/prometheus
406 output_dir: mycharts
407
408 - name: Render templates
409 kubernetes.core.helm_template:
410 chart_ref: stable/prometheus
411 register: result
412
413 - name: Write templates to file
414 copy:
415 dest: myfile.yaml
416 content: "{{ result.stdout }}"
417
418 - name: Render MutatingWebhooksConfiguration for revision tag "canary", rev "1-13-0"
419 kubernetes.core.helm_template:
420 chart_ref: istio/istiod
421 chart_version: "1.13.0"
422 release_namespace: "istio-system"
423 show_only:
424 - "templates/revision-tags.yaml"
425 release_values:
426 revision: "1-13-0"
427 revisionTags:
428 - "canary"
429 register: result
430
431 - name: Write templates to file
432 copy:
433 dest: myfile.yaml
434 content: "{{ result.stdout }}"
435
436
437
438 Return Values
439 -------------
440 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:
441
442 .. raw:: html
443
444 <table border=0 cellpadding=0 class="documentation-table">
445 <tr>
446 <th colspan="1">Key</th>
447 <th>Returned</th>
448 <th width="100%">Description</th>
449 </tr>
450 <tr>
451 <td colspan="1">
452 <div class="ansibleOptionAnchor" id="return-"></div>
453 <b>command</b>
454 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
455 <div style="font-size: small">
456 <span style="color: purple">string</span>
457 </div>
458 </td>
459 <td>always</td>
460 <td>
461 <div>Full <code>helm</code> command run by this module, in case you want to re-run the command outside the module or debug a problem.</div>
462 <br/>
463 <div style="font-size: smaller"><b>Sample:</b></div>
464 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">helm template --output-dir mychart nginx-stable/nginx-ingress</div>
465 </td>
466 </tr>
467 <tr>
468 <td colspan="1">
469 <div class="ansibleOptionAnchor" id="return-"></div>
470 <b>stderr</b>
471 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
472 <div style="font-size: small">
473 <span style="color: purple">string</span>
474 </div>
475 </td>
476 <td>always</td>
477 <td>
478 <div>Full <code>helm</code> command stderr, in case you want to display it or examine the event log.</div>
479 <br/>
480 </td>
481 </tr>
482 <tr>
483 <td colspan="1">
484 <div class="ansibleOptionAnchor" id="return-"></div>
485 <b>stdout</b>
486 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
487 <div style="font-size: small">
488 <span style="color: purple">string</span>
489 </div>
490 </td>
491 <td>always</td>
492 <td>
493 <div>Full <code>helm</code> command stdout. If no <em>output_dir</em> has been provided this will contain the rendered templates as concatenated yaml documents.</div>
494 <br/>
495 </td>
496 </tr>
497 </table>
498 <br/><br/>
499
500
501 Status
502 ------
503
504
505 Authors
506 ~~~~~~~
507
508 - Mike Graves (@gravesm)