An administrator is creating a new inventory file for a small environment. The inventory must define a group `app` containing hosts `app1` and `app2`, and a group `db` containing host `db1`. The administrator wants to use the INI format. Which inventory file content correctly defines these groups?
This content correctly uses INI section headers to define groups. The group `app` contains app1 and app2, and the group `db` contains db1. There are no syntax errors, and the format matches Ansible's INI inventory requirements. This is the valid and straightforward way to define static groups in an INI inventory file.
Why this answer
Ansible INI inventory files use square-bracketed group names followed by one host per line. The correct content defines the `app` group with app1 and app2 on separate lines, and the `db` group with db1. The other options use invalid syntax such as key-value pairs, non-standard keywords, or comma-separated hosts, which Ansible would not parse as intended.
Exam trap
The trap here is assuming that comma-separated hosts or YAML-like structures are valid in INI inventory files, when each host must be on its own line.