kael_k.ansible_mustache.mustache (1.0.1) — module

mustache templating

Authors: kael_k - D'Alcamo Kael (kael-k on gh)

Install collection

Install with ansible-galaxy collection install kael_k.ansible_mustache:==1.0.1


Add to requirements.yml

  collections:
    - name: kael_k.ansible_mustache
      version: 1.0.1

Description

The mustache module purpose is to parse an mustache template with variables and output the compiled template


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Render an "Hello world!"
- kael_k.ansible_mustache.mustache:
    template: "{{ greetings }} {{ target }}!"
    values:
        greetings: Hello
        target: world
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Since is strict validation on missing tag is enabled and
# target is not defined in values, this task will fail
- kael_k.ansible_mustache.mustache:
    template: "{{ greetings }} {{ target }}!"
    strict: true
    values:
        greetings: Hello

Inputs

    
strict:
    default: false
    description:
    - strict validation on missing tag
    type: bool

values:
    description:
    - values to provide for template rendering
    required: true
    type: dict

template:
    description:
    - mustache template to render
    required: true
    type: str

Outputs

rendered_template:
  description: contains the output of the template rendering
  returned: only if success is True
  type: str
success:
  description: check if template was compiled successfully
  returned: always
  type: bool