← 返回命令列表

Linux command

ansible-doc 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show

ansible-doc [apt]

List

ansible-doc -l

Example

ansible-doc -l | grep [docker]

Example

ansible-doc -s [yum]

Example

ansible-doc [community.docker.docker_container]

Example

ansible-doc -t [callback] -l

说明

ansible-doc displays documentation for Ansible modules, plugins, and collections. It shows module parameters, return values, examples, and notes, serving as a quick reference without needing to access online documentation. The tool can list all available modules and filter by plugin type, making it useful for discovering available automation options.

参数

-l, --list
List available modules or plugins
-s, --snippet
Show playbook snippet for module
-t _type_, --type _type_
Plugin type: module, callback, connection, lookup, etc.
-F, --list_files
Show module source files
-j, --json
Output in JSON format
-M _path_, --module-path _path_
Additional module search path

FAQ

What is the ansible-doc command used for?

ansible-doc displays documentation for Ansible modules, plugins, and collections. It shows module parameters, return values, examples, and notes, serving as a quick reference without needing to access online documentation. The tool can list all available modules and filter by plugin type, making it useful for discovering available automation options.

How do I run a basic ansible-doc example?

Run `ansible-doc [apt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --list do in ansible-doc?

List available modules or plugins