Where Variables Come From & Precedence
A first map of variable sources.
So Many Sources
The same variable can be set in many places: inventory, play vars, files, the CLI and more. So which value actually wins? 🌟
Precedence Decides
Ansible follows a fixed order called variable precedence. When a name is set twice, the higher-priority source overrides the lower one.
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