Automation · Configuration Management
Variables
Cheat sheet · https://pcornel.dk/topic.php?topic=5383
Answer
Variables in configuration management supply node- and group-specific values to roles and templates, with a defined precedence order. Keep secrets in encrypted variables or a vault.
Remember
- Variables supply values to roles and templates.
- Know the precedence order.
- Encrypt secrets.
First checks
ansible-inventory --host <h>— effective vars- group_vars/host_vars layout — structure
- Variable precedence documented — clarity
Verify in this order
defaults → group_vars → host_vars → extra vars
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5383