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.

All Ansible questions Roadmap: Ansible

More on Inventory