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
DOCUMENTATIONstrings β¨ - 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 includingroles/,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-vincreases 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 pathANSIBLE_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 β
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