Use it when the symptom is “Inventory Problems”: work through the layers in order and stop at the first one that fails.
Inventory Problems
Inventory Problems isolates wrong, missing, duplicate or stale automation targets and target metadata before execution fans out to unintended hosts, devices, groups or environments.
1. Inventory problems: missing/extra hosts, wrong groups, wrong vars, stale cache.
2. Check the source of truth.
3. Refresh caches.
4. Validate inventory in CI.
5. Fix at source.
SoT → inventory plugin → hosts/groups
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
intent/scope → inventory source revision → dynamic/static resolution → groups/selectors → normalized target identity → per-target variables/credentials → operation → target-set verification
Healthy evidence: inventory revision and selector are frozen, resolved stable IDs exactly match intended scope, metadata is validated, and execution evidence maps one-to-one to targets.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: floating dynamic inventory changes mid-run, hostnames are the only identity, extra targets are tolerated, or local inventory edits bypass the source of truth.
Step 3 Common mistakes Narrow the fault
- Hosts missing from dynamic inventory because of filters.
Step 4 Where it fails Narrow the fault
Where Inventory Problems usually goes wrong: source authority, host/object identity, grouping/selection, staleness and downstream target resolution.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- 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.
ansible-inventory --graph— structureansible-inventory --host <h>— vars- SoT records for missing hosts — source data
ReferenceWhat it is1 section · depth on demand
Core model
Pin inventory source revision and rendered host set; inspect selectors/groups/dynamic inventory filters; normalize identifiers; detect duplicates and stale objects; compare intended versus selected targets before mutation; correct the source of truth and rerun a dry/preflight selection.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Inventory correctness can be confirmed only against a defined intended target set and source snapshot; reachability or successful parsing does not show membership is right.
In depth
Inventory problems cause automation to target the wrong systems, skip systems or use wrong connection settings. Typical causes are stale host lists, wrong group membership, variable precedence and dynamic inventory filters.
ansible-inventory -i inventory/ --graph
ansible-inventory -i inventory/ --host sw01 | jq '{ansible_host, ansible_network_os}'
ansible-playbook site.yml --list-hosts --limit oslo
| Symptom | Cause |
|---|---|
| Host missing from run | Filter or status in source of truth |
| Wrong driver used | ansible_network_os set at wrong group |
| Decommissioned device targeted | Static inventory not updated |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation Troubleshooting > Inventory Problems. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/architecture/patterns/retry · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Inventory Problems troubleshooting proof-boundary map
Fast symptom/scope, first-failed-boundary, effective-outcome and recovery/closure map for Inventory Problems.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Symptom / scope | Time window, immutable source/run identity, effective inputs and exact targets are explicit | Floating source, changed inputs or ambiguous targets destroy reproducibility |
| First failed boundary | Transport/auth/dependency/render/operation evidence identifies the earliest divergence | Investigation starts at the final error and skips earlier unproven boundaries |
| Effective outcome | Controller result is paired with target read-back and workload/service acceptance | Green execution state or changed symptom substitutes for effective-state verification |
| Recovery / closure | Minimal change restores the original test and regression/partial-state checks are clean | Broad retry or unrelated edits make the incident non-reproducible and hide residual state |
Deep reference
Healthy vs suspicious evidence
Output interpretation
For Inventory Problems, rely on structured fields and stable IDs (source authority, host/object identity, grouping/selection, staleness and downstream target resolution) rather than text formatted for display.