How do you create groups of groups?
BeginnerConceptInventory
Answer
Use the :children suffix in INI, or children: in YAML.
[web]
web1
web2
[db]
db1
[prod:children]
web
db
A play with hosts: prod hits all three hosts. Variables set on prod apply to all of them, and child group variables override parent group variables.
More on Inventory
What is an inventory and why does Ansible need one?BeginnerWhat are the INI and YAML inventory formats and how do they differ?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