0Pricing
Ansible Academy · Lesson

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

  1. Defining & Using vars in a Play
  2. The {{ }} Substitution Syntax
  3. Extra Vars on the Command Line
  4. Where Variables Come From & Precedence
← Back to Ansible Academy