Automation · Inventory
Static Inventory
Cheat sheet · https://pcornel.dk/topic.php?topic=5845
Answer
A static inventory is a hand-written file listing hosts and groups, such as an Ansible INI or YAML inventory. It is simple and reviewable but must be updated when systems change.
Remember
- Static inventory is a hand-written file.
- Simple and reviewable in Git.
- Must be updated when systems change.
First checks
cat inventory/hosts.yml— static fileansible-inventory -i inventory/hosts.yml --graph— parse- Review cadence — accuracy
Verify in this order
file → inventory
Where it usually breaks
Inventory/vars → play/task selection → connection/become → module request → module result → target object read-back → handler/service effective state → workload verification.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5845