Quiz Entry - updated: 2026.10.30
How do you find the right module for a task and learn how to use it?
Browse the module index at docs.ansible.com, or use ansible-doc on the control node: ansible-doc -l lists installed modules, ansible-doc <module> shows its description, options (mandatory ones marked) and example snippets.
$ ansible-doc yum
> YUM (.../ansible/modules/packaging/os/yum.py)
Installs, upgrade, downgrades, removes, and lists packages and groups
with the `yum' package manager. ...
OPTIONS (= is mandatory):
- allow_downgrade
... can make this module behave in a non-idempotent way ...
[Default: no]
type: bool
Ansible ships hundreds of modules, so you don't memorise them; you look them up. Both routes give the same content:
- The online index groups modules by collection and topic (system modules for users and services, database modules, cloud, network...).
ansible-docworks offline and always matches the exact version installed, which matters because options change between releases. ItsEXAMPLESsection can be pasted into a playbook and adapted.ansible-doc -s <module>prints just a playbook snippet.
Read the option notes: here the documentation warns that allow_downgrade=True can break idempotency.
Go deeper:
ansible-doc command reference (official docs) —
-l,-s,-tand plugin types.ansible.builtin collection index (official docs) — every module that ships with ansible-core.