Jinja template

A text file containing Jinja expressions that Ansible fills in with each host's variables to produce a finished file.

In more detail

By convention it ends in .j2 and lives in a templates directory beside the playbook or role. Whitespace, quoting and line endings in the template are part of the output, so check the rendered file when a program is fussy about formatting.

Example

templates/message.j2

Related terms

Taught in

References

Certification courses