Quiz Entry - updated: 2026.10.22
What is a dynamic inventory, and why is it useful?
An inventory that is generated at run time from an external source (a cloud API, a CMDB, a virtualisation platform) instead of being typed into a static file.
An inventory is the list of hosts Ansible manages, organised into groups. It can be:
- static: a text file you maintain by hand, or
- dynamic: produced by a script or inventory plugin that asks an external source, such as AWS, VMware or a CMDB (configuration management database), which machines currently exist.
Dynamic inventories matter in environments where machines come and go. If autoscaling creates five new web servers at night, a static file is immediately out of date; a dynamic inventory picks them up on the next run automatically. The result is always the correct, current list of managed servers, wherever they are.
Go deeper:
Working with dynamic inventory (official docs) — inventory plugins vs legacy scripts, and mixing dynamic and static sources.
How to build your inventory (official docs) — static inventory, groups, nested groups and group variables, the base a dynamic one replaces.
Configuration management database (Wikipedia) — what a CMDB is, a common dynamic-inventory source.