Pcornel
Automation · Configuration Management

Inventory

Cheat sheet · https://pcornel.dk/topic.php?topic=5382

Back to the Topic

Answer

Inventory in configuration management lists the managed nodes and groups them by role, environment or location, with variables that tailor the configuration each node receives.

Remember

  • Inventory groups nodes by role, environment and location.
  • Group variables tailor configuration.
  • Generate inventory from a source of truth where possible.

First checks

  • ansible-inventory --graph — structure
  • ansible-inventory --list | jq '._meta.hostvars | keys | length' — hosts
  • Dynamic source — accuracy

Verify in this order

source → inventory → targets

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=5382

Confirmation

Confirm action

Continue?