Variables & Data¶
"Why isn't my variable taking effect?" is the most common Ansible support question there is. This section is the complete, definitive answer — starting broad, then narrowing to the exact precedence order.
Read in this order¶
- Variable Types and Sources
- Variable Precedence — the definitive order, highest to lowest
- Facts
- Registered Variables
- Magic Variables and Hostvars
- set_fact and combine
Related¶
- Variable Precedence Cheat Sheet — the pyramid, no prose
- Jinja2 & Templates — what you do with a variable once you have it
Next¶
Continue to Jinja2 & Templates.