Quiz Entry - updated: 2026.10.30
In short: how do inventory, ansible.cfg, playbooks and modules fit together when you run Ansible?
The inventory says which hosts exist, ansible.cfg says how to reach them and how to become root, the playbook says what state they should be in, and modules do the work on each host, all started from the control node with ansible or ansible-playbook.
- Inventory (INI or YAML, static or dynamic): hosts and groups, possibly nested, plus host and group variables.
ansible.cfg(first found ofANSIBLE_CONFIG,./ansible.cfg,~/.ansible.cfg,/etc/ansible/ansible.cfg): default inventory, remote user, SSH key, privilege escalation.- Playbook (YAML): a list of plays; each play is an ordered list of tasks applied to hosts selected from the inventory.
- Modules: standardised code that implements tasks and reports
ok/changed/failed. Look them up withansible-docor the docs site. - Commands:
ansibleruns one ad-hoc task,ansible-playbookchecks syntax (--syntax-check) and runs playbooks.
A useful order for a new project: write the inventory and check it with --list-hosts, test connectivity with ansible all -m ping, write the playbook, --syntax-check it, run it, then run it again and expect changed=0.
Go deeper:
Building Ansible inventories (official docs) — the inventory guide this workflow starts from.
Ansible (software) (Wikipedia) — overview of architecture and history.