LOGBOOK

HELP

Quiz Entry - updated: 2026.11.12

How do you find out which options a module accepts without leaving the terminal, and why might an option you need be missing from the ansible.builtin.package documentation?

Run ansible-doc <module>, for example ansible-doc ansible.builtin.apt. The package page documents only the options that every package manager shares, because package is a proxy that hands its arguments to the real module (apt, dnf, ...); manager-specific options such as update_cache are on that module's page.

ansible-doc reads the documentation built into the installed modules, so it always matches the Ansible version on your control node and works offline. ansible-doc -l lists all modules; ansible-doc -s <module> prints a short snippet of all options to paste into a playbook.

ansible.builtin.package exists so that one task can install software on Debian and Red Hat hosts alike. It looks at the host's facts (running fact gathering itself if needed), picks apt, dnf or another backend, and passes every argument through. Its own page therefore covers only the common ground: name, state, use. An option like update_cache is accepted because the backend accepts it.

The way to an answer is the one the error message suggests: the hint says "apt-get update", so look at the apt module's options and find update_cache ("Run the equivalent of apt-get update before the operation"). The catch is portability: an option that only one backend knows breaks the task on hosts that use another backend.

Go deeper:

From Quiz: ITIA / Ansible Variables, Secrets and Facts | Updated: Nov 12, 2026