Jinja2 & Templates¶
Every {{ }} in a playbook is Jinja2, not YAML. This section covers the templating language itself and its main production use — generating real config files from a single template plus per-environment variables.
Read in this order¶
- Jinja2 Basics — expressions, string interpolation, and where templating actually runs
- Filters and Tests —
| default,| join,is defined, and the rest - Templates for Config Generation — the
templatemodule,.j2files, loops and conditionals inside a template - Advanced Jinja2 — macros, whitespace control, custom filters
Next¶
Continue to Modules.