extra variables
Variables passed on the command line when a playbook starts, which override values from every other source.
In more detail
Use ansible-playbook -e name=value or --extra-vars. Because they win over everything, they suit one-off overrides at launch; values that belong to an environment should live in inventory files where reviewers can see them.
Example
ansible-playbook site.yml -e greeting=hiRelated terms
- variable precedence — The fixed order Ansible uses to decide which value wins when the same variable is set in several places.
- ansible-playbook — The command that runs a playbook, printing a banner for each play and task, a result per host, and a recap at the end.
Taught in
- Variables And Precedence — Ansible Configuration Management at Scale
- Inventory Variables: Ranges, group_vars And host_vars — RHCE in Ansible (EX294): Automate Red Hat Systems
- Variables And Where They Win: group_vars, host_vars And Play Vars — RHCE in Ansible (EX294): Automate Red Hat Systems