What is an inventory and why does Ansible need one?
BeginnerConceptInventory
Answer
The inventory is the list of managed hosts, organised into groups, plus the variables attached to them. It answers "which machines does this play touch?" through host patterns like hosts: web.
It can be a static INI/YAML file, a directory of files, or a dynamic source such as the AWS EC2 plugin. Without an inventory, Ansible only knows the implicit localhost.
More on Inventory
What are the INI and YAML inventory formats and how do they differ?BeginnerHow do you create groups of groups?BeginnerExplain host patterns: `:`, `:&`, `:!` and wildcards.IntermediateWhich connection variables can you set per host in inventory?BeginnerWhat are `group_vars` and `host_vars` directories?IntermediateHow do you define a range of hosts in an inventory?Beginner