How do you define a range of hosts in an inventory?

BeginnerConceptInventory
Answer

Use bracket ranges, numeric or alphabetic, with an optional stride and zero padding.

[web]
web[01:10].example.com
[dbs]
db-[a:c].example.com
[odd]
node[1:9:2]

The first expands to web01 through web10. Check with ansible-inventory --graph.

All Ansible questions Roadmap: Ansible

More on Inventory