What are the lowest and highest precedence sources, and why does that matter?
IntermediateConceptVariables, Facts and Precedence
Answer
Lowest is role defaults/main.yml, designed to be overridden by anything. Highest is extra vars (-e), which beat everything including set_fact and role vars.
This is why role defaults hold tunable settings, and why -e is a reliable override for a one-off run. It is also a trap in AWX: a job template's extra variables silently override your playbook logic, and an -e value cannot be changed from inside the play.
More on Variables, Facts and Precedence
Where can you define variables in Ansible?BeginnerHow do you reference a variable, and when must you quote it?BeginnerGive a summary of variable precedence.IntermediateWhat is the difference between a role's `defaults/` and `vars/`?IntermediateWhat are facts and how are they gathered?BeginnerWhat is the difference between `ansible_facts['x']` and the older `ansible_x` variables?Intermediate