ansible-doc(1)

πŸ’… ansible-doc(1) β€” the plugin documentation tool, bestie

okay so first things first: this page lives in the System administration commands section of the manual, and the whole thing is literally just ansible-doc β€” a tool that tells you everything about the plugins chillin' inside your Ansible libraries. think of it as a lil' encyclopedia you can summon from the terminal. πŸ¦‹


✨ SYNOPSIS ✨

usage: ansible-doc [-h] [--version] [-v] [-M MODULE_PATH]
       [--playbook-dir BASEDIR] [-t
       {become,cache,callback,cliconf,connection,httpapi,inventory,lookup,netconf,shell,vars,module,strategy,test,filter,role,keyword}]
       [-j] [-r ROLES_PATH] [-e ENTRY_POINT | -s | -F | -l |
       --metadata-dump] [--no-fail-on-errors] [plugin ...]

no cap, that's the whole vibe at a glance. πŸ’€


🌸 DESCRIPTION 🌸

so what does it do? it displays information on modules installed in Ansible libraries. that's the main character job, ok. but it does three lil' party tricks:

  • it shows you a terse listing of plugins along with their short descriptions πŸ‘‘
  • it gives you a printout of their DOCUMENTATION strings ✨
  • and it can cook up a short "snippet" that you can literally paste straight into a playbook πŸŽ€

it's giving "reference manual + copy-paste queen". obsessed.


πŸ’œ COMMON OPTIONS πŸ’œ

πŸ”Œ Plugin

  • --metadata-dump β€” for internal use only!! this dumps json metadata for all entries and ignores all other options. like, it's not even listening to you anymore. πŸ™ˆ
  • --no-fail-on-errors β€” also for internal use only, and only used with --metadata-dump. it means "don't fail on errors" β€” instead, it reports the error message inside the JSON. so the error still exists, it's just, like, ✨documented✨.
  • --playbook-dir 'BASEDIR' β€” since this tool doesn't use playbooks (iconic of it), use this as a substitute playbook directory. this sets the relative path for a bunch of features including roles/, group_vars/, etc. your fake playbook home base 🏠
  • --version β€” show the program's version number, config file location, configured module search path, module location, executable location, and then exit. it's the full ✨receipts✨ dump.
  • -F, --list_files β€” show plugin names and their source files without summaries (this implies --list). if you pass an argument, it'll be used for filtering β€” and that filter can be a namespace or full collection name. πŸ—‚οΈ
  • -M, --module-path β€” prepend colon-separated path(s) to the module library (default={{ ANSIBLE_HOME ~ "/plugins/modules:/usr/share/ansible/plugins/modules" }}). this argument may be specified multiple times β€” stack 'em up, no shade. πŸ”₯
  • -e 'ENTRY_POINT', --entry-point 'ENTRY_POINT' β€” select the entry point for role(s). that's it, that's the whole thing. 🎯
  • -h, --help β€” show this help message and exit. the classic. the og. 🫢
  • -j, --json β€” change output into json format. for when you want your data machine-readable, fr fr. πŸ€–
  • -l, --list β€” list available plugins. if you supply an argument it gets used for filtering, and that filter can be a namespace or full collection name. πŸ’…
  • -r, --roles-path β€” the path to the directory containing your roles. this argument may be specified multiple times. yes queen, multiple times. πŸŽ€
  • -s, --snippet β€” show playbook snippet for these plugin types: inventory, lookup, module. the copy-paste shortcut of your dreams ✨
  • -t 'TYPE', --type 'TYPE' β€” choose which plugin type (defaults to "module"). available plugin types are: ('become', 'cache', 'callback', 'cliconf', 'connection', 'httpapi', 'inventory', 'lookup', 'netconf', 'shell', 'vars', 'module', 'strategy', 'test', 'filter', 'role', 'keyword'). seventeen of 'em. pick your fighter πŸ‘‘
  • -v, --verbose β€” causes Ansible to print more debug messages. adding multiple -v increases the verbosity, and the builtin plugins currently evaluate up to -vvvvvv. a reasonable level to start is -vvv, and connection debugging might require -vvvv. this argument may be specified multiple times. verbose? me? never. 😭

🌈 ENVIRONMENT 🌈

the following environment variables may be specified:

  • ANSIBLE_LIBRARY β€” override the default ansible module library path
  • ANSIBLE_CONFIG β€” specify override location for the ansible config file

many more are available for most options in ansible.cfg β€” like, a lot a lot.

for a full list check <https://docs.ansible.com/>. or just use the ansible-config command. iykyk πŸ’œ


πŸ¦‹ FILES πŸ¦‹

  • /etc/ansible/ansible.cfg β€” config file, used if present
  • ~/.ansible.cfg β€” user config file, overrides the default config if present
  • ./ansible.cfg β€” local config file (in current working directory), assumed to be 'project specific' and overrides the rest if present

as mentioned above, the ANSIBLE_CONFIG environment variable will override all others. it's the final boss of config precedence πŸ‘‘


🧚 AUTHOR 🧚

Ansible was originally written by Michael DeHaan. legend behavior, honestly. 🫢


Copyright Β© 2018 Red Hat, Inc | Ansible. Ansible is released under the terms of the GPLv3 license. slay and legally binding πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

  • ansible (1)
  • ansible-config (1)
  • ansible-console (1)
  • ansible-galaxy (1)
  • ansible-inventory (1)
  • ansible-playbook (1)
  • ansible-pull (1)
  • ansible-vault (1)

extensive documentation is available in the documentation site: <<https://docs.ansible.com>>. IRC and mailing list info can be found in file CONTRIBUTING.md, available in: <<https://github.com/ansible/ansible>> πŸ“


bestie reminder: the doc site is your bestie, the man page is your bestie, and --help is always one keystroke away πŸ’–

okay that's the whole page!! this was scanned and served to you straight from Ansible 2.22.0, and yeah β€” it's the ansible-doc(1) page, the one and only. go read some plugin docs, you absolute icon πŸŒΈβœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: ansible-core 2.22.0-1 Β· GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms