community.kubernetes.helm_template (1.2.1) — module

Render chart templates

Authors: Mike Graves (@gravesm)

Install collection

Install with ansible-galaxy collection install community.kubernetes:==1.2.1


Add to requirements.yml

  collections:
    - name: community.kubernetes
      version: 1.2.1

Description

Render chart templates to an output directory or as text of concatenated yaml documents.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Render templates to specified directory
  community.kubernetes.helm_template:
    chart_ref: stable/prometheus
    output_dir: mycharts
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Render templates
  community.kubernetes.helm_template:
    chart_ref: stable/prometheus
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Write templates to file
  copy:
    dest: myfile.yaml
    content: "{{ result.stdout }}"

Inputs

    
chart_ref:
    description:
    - Chart reference with repo prefix, for example, C(nginx-stable/nginx-ingress).
    - Path to a packaged chart.
    - Path to an unpacked chart directory.
    - Absolute URL.
    required: true
    type: path

output_dir:
    description:
    - Output directory where templates will be written.
    - If the directory already exists, it will be overwritten.
    required: false
    type: path

binary_path:
    description:
    - The path of a helm binary to use.
    required: false
    type: path

include_crds:
    default: false
    description:
    - Include custom resource descriptions in rendered templates.
    required: false
    type: bool

values_files:
    default: []
    description:
    - Value files to pass to chart.
    - Paths will be read from the target host's filesystem, not the host running ansible.
    - I(values_files) option is evaluated before I(values) option if both are used.
    - Paths are evaluated in the order the paths are specified.
    elements: str
    required: false
    type: list

chart_version:
    description:
    - Chart version to use. If this is not specified, the latest version is installed.
    required: false
    type: str

chart_repo_url:
    description:
    - Chart repository URL where the requested chart is located.
    required: false
    type: str

release_values:
    aliases:
    - values
    default: {}
    description:
    - Values to pass to chart.
    required: false
    type: dict

update_repo_cache:
    default: false
    description:
    - Run C(helm repo update) before the operation. Can be run as part of the template
      generation or as a separate step.
    type: bool

Outputs

command:
  description: Full C(helm) command run by this module, in case you want to re-run
    the command outside the module or debug a problem.
  returned: always
  sample: helm template --output-dir mychart nginx-stable/nginx-ingress
  type: str
stderr:
  description: Full C(helm) command stderr, in case you want to display it or examine
    the event log.
  returned: always
  sample: ''
  type: str
stdout:
  description: Full C(helm) command stdout. If no I(output_dir) has been provided
    this will contain the rendered templates as concatenated yaml documents.
  returned: always
  sample: ''
  type: str