Quiz Entry - updated: 2026.10.30
How is a static inventory written in INI format?
A group name in square brackets, followed by one host per line; hosts listed before any header are ungrouped, and the same host may appear under several headers.
[webservers]
web1.example.com
web2.example.com
192.0.2.42
[db-servers]
db1.example.com
db2.example.com
[east-datacenter]
web1.example.com
db1.example.com
[production]
web1.example.com
web2.example.com
db1.example.com
db2.example.com
[development]
192.0.2.42
Read it like this: [webservers] opens a group, and every following line until the next header is a member. Hosts may be names or IP addresses. Because groups are just labels, web1.example.com is at the same time a web server, in the east data centre and in production, so you can target any of these slices. A play aimed at production reaches four machines; one aimed at east-datacenter reaches two.
INI is the traditional, simplest format and is typically stored in a file just called inventory (no extension) or with .ini.
Go deeper:
How to build your inventory (official docs) — "Inventory basics: formats, hosts, and groups", with the same file side by side in INI and YAML.
INI file (Wikipedia) — the section/key format the inventory and
ansible.cfgboth borrow.