0

我是 Ansible 的新手,对使用 Ansbile 2.9.15 的 Ansible Tower 3.7.4 非常陌生。我正在尝试做一个在 Git 存储库中运行 ansible 脚本的基本模板。注意:如果我在带有 python 和 ansible-galaxy 的 linux 机器上安装 ansible,我可以提取集合并且一切正常。但是,在 Ansible Tower 中,并没有看到我从 ansible-galaxy 中提取的集合。这是我得到的错误

ERROR! couldn't resolve module/action 'community.kubernetes.k8s'. This often indicates a misspelling, missing collection, or incorrect module path.

我的 ansible playbook 主要级别的 collections 目录中有一个 requirements.yml 文件。这是它的内容

collections:
- name: community.aws
- name: community.kubernetes

目录结构是

- ansible
  - collections
    - requirements.yml
  - roles
    - openshift
      - tasks
        - main.yml
  - main.yml

这是我在 Ansible Tower 中运行模板时的完整输出

ansible-playbook 2.9.15
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug 13 2020, 02:51:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /etc/ansible/ansible.cfg as config file
SSH password: 
host_list declined parsing /tmp/awx_66_8ffiwxxz/tmp32f5fpkw as it did not pass its verify_file() method
Parsed /tmp/awx_66_8ffiwxxz/tmp32f5fpkw inventory source with script plugin
ERROR! couldn't resolve module/action 'community.kubernetes.k8s'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/tmp/awx_66_8ffiwxxz/project/confluent/ansible/roles/openshift/tasks/main.yml': line 17, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
# Ensure namespace is created
- name: Create Confluent namespace / project
  ^ here

知道我做错了什么吗?

4

0 回答 0