LOGBOOK

HELP

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 of ANSIBLE_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 with ansible-doc or the docs site.
  • Commands: ansible runs one ad-hoc task, ansible-playbook checks 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:

From Quiz: ITIA / Ansible Inventory, Configuration and Playbooks | Updated: Oct 30, 2026