Skip to content

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

  1. Jinja2 Basics — expressions, string interpolation, and where templating actually runs
  2. Filters and Tests| default, | join, is defined, and the rest
  3. Templates for Config Generation — the template module, .j2 files, loops and conditionals inside a template
  4. Advanced Jinja2 — macros, whitespace control, custom filters

Next

Continue to Modules.