kubernetes.core.helm_template module – Render chart templates
Note
This module is part of the kubernetes.core collection (version 3.2.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install kubernetes.core
.
To use it in a playbook, specify: kubernetes.core.helm_template
.
Synopsis
Render chart templates to an output directory or as text of concatenated yaml documents.
Parameters
Parameter |
Comments |
---|---|
The path of a helm binary to use. |
|
Chart reference with repo prefix, for example, Path to a packaged chart. Path to an unpacked chart directory. Absolute URL. |
|
Chart repository URL where the requested chart is located. |
|
Chart version to use. If this is not specified, the latest version is installed. |
|
Run helm dependency update before the operation. The dependency_update option require the add of For more information please visit https://helm.sh/docs/helm/helm_dependency/ Choices:
|
|
Prevent hooks from running during install. Choices:
|
|
Include custom resource descriptions in rendered templates. Choices:
|
|
Output directory where templates will be written. If the directory already exists, it will be overwritten. |
|
Release name to use in rendered templates. |
|
namespace scope for this request. |
|
Values to pass to chart. Default: |
|
Values to pass to chart configuration. |
|
Value to pass to chart configuration (e.g phase=prod). |
|
Use Use Use Use Choices:
|
|
Only show manifests rendered from the given templates. Default: |
|
Run Choices:
|
|
Value files to pass to chart. Paths will be read from the target host’s filesystem, not the host running ansible. values_files option is evaluated before values option if both are used. Paths are evaluated in the order the paths are specified. Default: |
Examples
- name: Render templates to specified directory
kubernetes.core.helm_template:
chart_ref: stable/prometheus
output_dir: mycharts
- name: Render templates
kubernetes.core.helm_template:
chart_ref: stable/prometheus
register: result
- name: Write templates to file
copy:
dest: myfile.yaml
content: "{{ result.stdout }}"
- name: Render MutatingWebhooksConfiguration for revision tag "canary", rev "1-13-0"
kubernetes.core.helm_template:
chart_ref: istio/istiod
chart_version: "1.13.0"
release_namespace: "istio-system"
show_only:
- "templates/revision-tags.yaml"
release_values:
revision: "1-13-0"
revisionTags:
- "canary"
register: result
- name: Write templates to file
copy:
dest: myfile.yaml
content: "{{ result.stdout }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Full Returned: always Sample: |
|
Full Returned: always Sample: |
|
Full Returned: always Sample: |