community.general.a_module test – 测试给定字符串是否引用现有模块或操作插件
注意
此测试插件是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 Playbook 中使用它,请指定:community.general.a_module。
community.general 4.0.0 中的新增功能
概要
- 测试给定字符串是否引用现有模块或操作插件。 
- 这在角色中很有用,角色可以使用它来确保提前存在所需的模块。 
输入
这描述了测试的输入,即 is community.general.a_module 或 is not community.general.a_module 之前的值。
| 参数 | 注释 | 
|---|---|
| 一个字符串,表示模块或操作插件的完全限定集合名称 (FQCN)。 | 
示例
- name: Make sure that community.aws.route53 is available
  ansible.builtin.assert:
    that:
      - >
        'community.aws.route53' is community.general.a_module
- name: Make sure that community.general.does_not_exist is not a module or action plugin
  ansible.builtin.assert:
    that:
      - "'community.general.does_not_exist' is not community.general.a_module"
返回值
| 键 | 描述 | 
|---|---|
| 输入所表示的模块或操作插件是否存在。 返回: 成功 | 
