Use this when defining which systems automation manages and with which variables.
Inventory
Inventory is the list of systems automation manages, with groups and variables such as addresses, roles and platforms, kept statically in files or generated dynamically from a CMDB, cloud or NetBox.
1. Inventory drives automation targets and variables.
2. Generate from source of truth.
3. Group logically.
4. Validate.
5. Keep secrets out.
SoT → inventory → automation
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 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as duplicate labels, stale inventory, conflicting authority, broad filters, race between read and write, orphaned relationships and automation acting on data not yet reconciled, choosing the cases most relevant to authoritative object selection, revision/freshness, relationship traversal and preventing automation from using stale or duplicate inventory records.
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.
Subtopics
Go one level deeper into this subject.
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.
Subtopic HostsHosts in an inventory are individual managed systems, each with a name, connection address and host variables such as platform, credentials reference or role.
Subtopic GroupsInventory groups organize hosts by role, environment, site or platform, such as webservers or prod, so automation targets and variables apply to many hosts at once.
Subtopic VariablesInventory variables are values attached to hosts or groups, such as ansible_host or ntp_servers, often kept in host_vars and group_vars directories, with host values overriding group values.
Subtopic Static InventoryA static inventory is a hand-written file listing hosts and groups, such as an Ansible INI or YAML inventory.
Subtopic Dynamic InventoryDynamic inventory generates the host list at runtime from a source like AWS, vSphere, Proxmox or NetBox using plugins, so automation always targets what actually exists.
Subtopic Source of TruthAn inventory sourced from a source of truth such as NetBox or a CMDB keeps host lists, groups and variables in one authoritative place, avoiding inventories that drift apart.
Subtopic CMDBA CMDB (configuration management database) stores configuration items and their relationships, such as servers, applications and owners.
Subtopic DiscoveryDiscovery automatically finds systems and their details by scanning networks, querying cloud APIs, hypervisors or SNMP and LLDP, feeding inventories and highlighting unknown devices.
Subtopic Inventory ValidationInventory validation checks that hosts are reachable, names and addresses are unique, required variables are set and groups are correct before automation runs against them.
- Generate inventory from a source of truth when possible.
- Groups and variables tailor behaviour.
- Unreachable hosts must be visible, not silently skipped.
ansible-inventory --graph— groups- Inventory source (SoT) — authority
- Validation (all hosts reachable, required vars) — quality
ReferenceWhy it matters1 section · depth on demand
In depth
Inventory is the foundation of automation: before anything can be configured, monitored or audited, automation needs to know what exists, where it is and how to reach it. This group covers how inventories are structured (hosts and groups), where they come from (static files, dynamic sources, CMDB) and how they stay accurate.
| Question | Inventory answers |
|---|---|
| Which devices are at site X? | Group/site membership |
| How do I connect? | Address, platform, credentials reference |
| What role does it have? | Role/function attributes |
| Who owns it? | Ownership, contact |
An inventory is only as useful as its accuracy, so the best inventories are generated from an authoritative source and checked automatically against what is actually on the network.
ReferenceImportant terms & boundaries2 sections · depth on demand
Platform, version and operating-envelope scope
Ansible collection/module behavior depends on ansible-core and collection versions plus target OS/provider.
Mechanics
Follow the chain of components authoritative input → API/database validation → object persistence → query/filter → automation consumer → target action → reconciliation/read-back and record which layer currently owns truth.
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 Inventory. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/enable-automation · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For authoritative object selection, revision/freshness, relationship traversal and preventing automation from using stale or duplicate inventory records, prefer typed fields and stable IDs over human presentation text.