LOGBOOK

HELP

Quiz Entry - updated: 2026.10.30

What is an Ansible inventory, and what can it contain?

The inventory is the list of hosts Ansible manages, organised into groups. Groups can contain child groups, a host can be in several groups, and the inventory can also set variables for hosts and groups.

Every Ansible command needs to know which machines it acts on; the inventory answers that. Its building blocks:

  • Hosts: hostnames or IP addresses of the managed nodes.
  • Groups: named collections of hosts that are managed together, for example webservers or production. A command or play then targets the group name instead of listing machines.
  • Nested groups: a group can have child groups, so us can consist of raleigh and mountainview.
  • Multiple membership: one host can be in many groups at once (by role, by location, by environment), so you can slice the same fleet different ways.
  • Variables: values that apply only to certain hosts or groups, used later by playbooks.

There are two ways to define it: a static inventory is a text file you maintain; a dynamic inventory is generated on demand by a script or plugin that asks an external source (a cloud account, Red Hat Satellite, a CMDB) which hosts currently exist.

Go deeper:

From Quiz: ITIA / Ansible Inventory, Configuration and Playbooks | Updated: Oct 30, 2026