0

我有一个 2.9.13 ansible 容器正在运行。我在容器中安装了一些集合,它们最终位于:

./root/.ansible/collections/ansible_collections/<namespace>/<collection>

当我从主目录中的文件夹运行剧本时,找不到角色。

ERROR! the role 'tower-verify' was not found in <namespace>.<collection>:redhat_cop.tower_configuration:ansible.tower:ansible.legacy:/home/<playbook>/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/<playbook>

它似乎检查了集合,但找不到它。

root@1a3f9e1234c5:~/.ansible/collections/ansible_collections/<namespace>/<collection>/roles# ls
tower-verify

我在剧本代码中有以下部分:

  collections:
    - <namespace>.<collection>
    - redhat_cop.tower_configuration
    - ansible.tower

  roles:
    - {role: tower-verify, tags: tower_verify}

ansible.cfg 条目:

# Install collections into [current dir]/ansible_collections/namespace/collections_name
collections_paths = ./

那么 ansible 真的在检查那个位置吗?

感谢您提前提供任何帮助。

4

1 回答 1

0

目前,我将 playbook 项目下的集合放在集合文件夹中。

于 2021-06-10T14:08:58.117 回答