什么 Ansible 命令可以列出或验证已安装的模块 - 无论是内置模块还是附加模块?

Joh*_*ery 6 ansible

我找不到有关要运行的任何命令的任何信息,以便显示/确认我的控制节点上安装了哪些附加 Ansible 模块或内置 Ansible 模块?

\n

关于内置,我知道有一些网页列出了这些东西,但它们肯定是版本相关的,这意味着我需要首先验证我的本地 Ansible 版本,然后找到一个列出所有内容的网页该特定版本 \xe2\x80\x94 的内置插件,即效率非常低。

\n

flo*_*ong 4

ansible-doc --list

$ ansible-doc --list | head
add_host                                                                            Add a host (and alternatively a group) to the ansible-playbook in-memory ...
amazon.aws.aws_az_info                                                              Gather information about availability zon...
amazon.aws.aws_caller_info                                                          Get information about the user and account being used to make ...
amazon.aws.aws_s3                                                                   manage obje...
amazon.aws.cloudformation                                                           Create or delete an AWS CloudFormat...
amazon.aws.cloudformation_info                                                      Obtain information about an AWS CloudFormat...
amazon.aws.ec2                                                                      create, terminate, start or stop an instan...
amazon.aws.ec2_ami                                                                  Create or destroy an image (AM...
amazon.aws.ec2_ami_info                                                             Gather information about...
amazon.aws.ec2_eni                                                                  Create and optionally attach an Elastic Network Interface (ENI) to an...
Run Code Online (Sandbox Code Playgroud)

这也可以用于列出其他类型的可用插件,例如显示您将运行的所有查找插件ansible-doc -t lookup --list

  • 对不起,花儿歌。我是 Ansible 的新手,我所见过的大部分或全部 Ansible 文档都没有明确说明模块是一种插件。我无意冒犯。另外,我不能“只查看输出并看到它列出模块”,因为我对 Ansible 很陌生,我无法轻易区分模块名称和非模块插件名称之间的区别,假设它们的命名方式存在一些标准差异,而我对 Ansible 也太陌生,不知道这一点。 (2认同)