Pcornel
Automation · Inventory

Inventory Fundamentals

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

Back to the Topic

Answer

Inventory fundamentals: every host the automation manages is listed once, grouped meaningfully, with connection details and variables, ideally generated from a source of truth rather than maintained by hand.

Remember

  • List every managed host once.
  • Group and add variables.
  • Prefer generated over hand-written inventory.

First checks

  • Inventory format (YAML/INI/plugin) — type
  • ansible-inventory --list — parsed result
  • Ownership of inventory data — accountability

Verify in this order

source → hosts/groups/vars

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

Confirmation

Confirm action

Continue?