The {{ }} Substitution Syntax
Inject variables into strings and args.
Meet Jinja2
The double curly braces come from Jinja2, the templating engine Ansible uses. Anything inside them is an expression to evaluate. 🌟
The Basic Substitution
At its simplest, {{ name }} is replaced with the value of name. Ansible evaluates it before the module runs.
msg: "Welcome, {{ name }}!"All lessons in this course
- Defining & Using vars in a Play
- The {{ }} Substitution Syntax
- Extra Vars on the Command Line
- Where Variables Come From & Precedence