广州石井做网站,北京市工程建设交易中心网站,网址收录入口,公司网站设计主页部分怎么做目录
基本用法
查看指定模块的文档
列出所有可用模块
搜索模块
显示模块参数的简单列表
显示详细的说明和示例
详细示例
查看 file 模块的文档
简略查看 copy 模块的参数 ansible-doc 是 Ansible 中的一个非常有用的命令行工具#xff0c;它可以帮助你查找和显示Ansi…目录
基本用法
查看指定模块的文档
列出所有可用模块
搜索模块
显示模块参数的简单列表
显示详细的说明和示例
详细示例
查看 file 模块的文档
简略查看 copy 模块的参数 ansible-doc 是 Ansible 中的一个非常有用的命令行工具它可以帮助你查找和显示Ansible模块的文档信息。通过这个命令你能快速了解每个模块的功能、参数和使用示例。 基本用法 查看指定模块的文档
ansible-doc module_name例如查看shell模块的文档
ansible-doc shell列出所有可用模块
ansible-doc -l此命令会列出所有可用的模块供你使用。 搜索模块
可以通过关键词搜索模块
ansible-doc -s keyword例如搜索和文件相关的模块
ansible-doc -s file显示模块参数的简单列表
ansible-doc -s module_name例如查看copy模块的参数
ansible-doc -s copy显示详细的说明和示例 除了上述的基础用法还可以查看每个模块的详细说明和示例这是通过默认显示的只需不带任何参数即可
ansible-doc module_name详细示例 查看 file 模块的文档
ansible-doc file会看到类似以下的输出 FILE (/usr/lib/python3.8/site-packages/ansible/modules/files/file.py)The file module manages file and directory properties. Tests andlogs output similarly to how ls would list a file, meaning itis one of the most commonly used modules.Options ( is mandatory):- attributes(added in 2.6)Change the attributes of a file, i.e. i, a, e. See man chattr.This requires the root user in most environments.aliases: attr- pathPath to the file being managed. This is required when adding, updating, or deleting a file or directory.type: str | required- stateIf the path exists, this will change the state of the file. States can be file, link, absent or directory.If set to absent, the file or directory or all children/specifical contents will be removed.If set to directory, an empty directory will be created.... (更多输出)简略查看 copy 模块的参数
ansible-doc -s copy会看到类似以下的输出
COPY (/usr/lib/python3.8/site-packages/ansible/modules/files/copy.py)The copy module copies a file from the local or remote machine toa location on the remote machine. If you need variable interpolationin copied files, use the template module. Consider using the unarchivemodule instead if you need to unpack the archive after downloading.OPTIONS ( is mandatory):
- backupThis boolean option controls the creation of a backup file with the timestamp before overwriting the file.type: booldefault: no- contentWhen used instead of src, sets the contents of a file directly to the specified value. This is for simple values primarily.... (更多输出)