Pcornel
Automation · Automation Troubleshooting

Inventory Problems

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

Back to the Topic

Answer

Inventory Problems isolates wrong, missing, duplicate or stale automation targets and target metadata before execution fans out to unintended hosts, devices, groups or environments.

Remember

  • Inventory parsed ≠ intended targets selected.
  • Host reachable ≠ host belongs in this change scope.
  • Same hostname label ≠ same physical/logical target.
  • Dynamic inventory refresh succeeded ≠ source data is current or semantically correct.

First checks

  • ansible-inventory --graph — structure
  • ansible-inventory --host <h> — vars
  • SoT records for missing hosts — source data

Verify in this order

SoT → inventory plugin → hosts/groups

Where it usually breaks

Inventory correctness can be proven only against a defined intended target set and source snapshot; reachability or successful parsing does not prove membership is right.

Inventory/vars → play/task selection → connection/become → module request → module result → target object read-back → handler/service effective state → workload verification.

Inventory Problems troubleshooting proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Symptom / scopeTime window, immutable source/run identity, effective inputs and exact targets are explicitFloating source, changed inputs or ambiguous targets destroy reproducibility
First failed boundaryTransport/auth/dependency/render/operation evidence identifies the earliest divergenceInvestigation starts at the final error and skips earlier unproven boundaries
Effective outcomeController result is paired with target read-back and workload/service acceptanceGreen execution state or changed symptom substitutes for effective-state verification
Recovery / closureMinimal change restores the original test and regression/partial-state checks are cleanBroad retry or unrelated edits make the incident non-reproducible and hide residual state

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6056

Confirmation

Confirm action

Continue?