kubernetes.core.helm_template module – Render chart templates
Note
This module is part of the kubernetes.core collection (version 2.3.2).
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
.
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. |
|
Include custom resource descriptions in rendered templates. Choices:
|
|
Output directory where templates will be written. If the directory already exists, it will be overwritten. |
|
namespace scope for this request. |
|
Values to pass to chart. Default: {} |
|
Only show manifests rendered from the given templates. |
|
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: “helm template –output-dir mychart nginx-stable/nginx-ingress” |
|
Full Returned: always Sample: “” |
|
Full Returned: always Sample: “” |
Authors
Mike Graves (@gravesm)