[root@localhost ~]# ansible-doc -h
Usage: ansible-doc [options] [module...]
Show Ansible module documentation 显示Ansible模块文档
Options:
--version show program's version number and exit 显示ansible-doc的版本号
-h, --help show this help message and exit 显示命令参数API文档
-M MODULE_PATH, --module-path=MODULE_PATH 查询模块,--module-path=MODULE_PATH 指定模块的路径
Ansible modules/ directory
-l, --list List available modules 显示已存在的所有模块列表
-s, --snippet Show playbook snippet for specified module(s) 显示playbook制定模块的用法
-v Show version number and exit 显示ansible-doc的版本号
举例:
$ ansible-doc -l
$ ansible-doc -s command
正如你所料,Ansible-doc是Ansible模块文档说明,针对每个模块都是详细的用法说明及应用案例介绍,功能和Linux系统man命令同等功效。该命令使用方式如下:
ansible-doc [options] [module...]
ansible-doc命令后跟[options]参数或[模块名]显示模块用法说明,具体示例如下:
//列出支持的模块
ansible-doc –l
//模块功能说明
ansible-doc ping
[root@node110 ansible]# ansible-doc -s command
- name: Executes a command on a remote node
action: command
chdir # cd into this directory before running the command
creates # a filename or (since 2.0) glob pattern, when it already exists, this step will *not* be run.
executable # change the shell used to execute the command. Should be an absolute path to the executable.
free_form= # the command module takes a free form command to run. There is no parameter actually named 'free
form'. See the examples!
removes # a filename or (since 2.0) glob pattern, when it does not exist, this step will *not* be run.
warn # if command warnings are on in ansible.cfg, do not warn about this particular line if set to
no/false.
2017-04-18
ansible-doc 命令
评论
发表评论
姓 名: