Почему AWX не видит плагин?

Есть AWX который должен создавать виртуальную машину в GCP. Для этого я установил плагин sudo pip install google-auth
Вот собственно код плейбука:
Код плейбука
---
- name: Create jenkins vm
  hosts: localhost
  connection: local
  gather_facts: no
  vars:
    service_account_email: ansible@geocitizen-app.iam.gserviceaccount.com
    credentials_file: /etc/conf/awx/awx.json
    project_id: geocitizen-app
    machine_type: f1-micro
    machine_name: jenkins-node-1
    image: https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20191014
    zone: europe-north1-a
  tasks:
   - name: Launch instances
     gcp_compute_instance:
       auth_kind: serviceaccount
       name: "{{ machine_name }}"
       machine_type: "{{ machine_type }}"
       #service_account_email: "{{ service_account_email }}"
       service_account_file: "{{ credentials_file }}"
       project: "{{ project_id }}"
       zone: "{{ zone }}"
       network_interfaces:
       - network:
         access_configs:
         - name: External NAT
           type: ONE_TO_ONE_NAT
       disks:
       - auto_delete: 'true'
         boot: 'true'
         initialize_params:
           source_image: "{{ image }}"

Когда я запускаю свой плейбук из консоли то все окей он выполняется. Делаю это так:
[root@awx ansible]$ ansible-playbook myplaybook.yml

Теперь я залил это дело в AWX (не знаю правильно ли говорить "залил", в общем делаю это через UI). После чего я запускаю свой шаблон и получаю такой вывод:
Ошибка AWX
ansible-playbook 2.8.6
  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  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /tmp/awx_20_i7oi_i6v/tmpsz28t9kv as it did not pass it's verify_file() method
Parsed /tmp/awx_20_i7oi_i6v/tmpsz28t9kv inventory source with script plugin
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
PLAYBOOK: createvm.yml *********************************************************
1 plays in createvm.yml
PLAY [Create jenkins vm] *******************************************************
META: ran handlers
TASK [Launch instances] ********************************************************
task path: /tmp/awx_20_i7oi_i6v/project/createvm.yml:15
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740 `" && echo ansible-tmp-1572876378.6-183253348571740="` echo /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_instance.py
<127.0.0.1> PUT /var/lib/awx/.ansible/tmp/ansible-local-379jmWiYK/tmpYS1Si3 TO /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740/AnsiballZ_gcp_compute_instance.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740/ /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740/AnsiballZ_gcp_compute_instance.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740/AnsiballZ_gcp_compute_instance.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1572876378.6-183253348571740/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "auth_kind": "serviceaccount", 
            "can_ip_forward": null, 
            "disks": [
                {
                    "auto_delete": true, 
                    "boot": true, 
                    "device_name": null, 
                    "disk_encryption_key": null, 
                    "index": null, 
                    "initialize_params": {
                        "disk_name": null, 
                        "disk_size_gb": null, 
                        "disk_type": null, 
                        "source_image": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20191014", 
                        "source_image_encryption_key": nu…
PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Если развернуть секцию с строчкой fatal то там:
Секция с fatal
{
    "_ansible_no_log": false,
    "invocation": {
        "module_args": {
            "status": null,
            "scopes": [
                "https://www.googleapis.com/auth/compute"
            ],
            "service_account_contents": null,
            "network_interfaces": [
                {
                    "access_configs": [
                        {
                            "type": "ONE_TO_ONE_NAT",
                            "name": "External NAT",
                            "nat_ip": null
                        }
                    ],
                    "subnetwork": null,
                    "network_ip": null,
                    "network": null,
                    "alias_ip_ranges": null
                }
            ],
            "machine_type": "f1-micro",
            "tags": null,
            "service_accounts": null,
            "guest_accelerators": null,
            "can_ip_forward": null,
            "scheduling": null,
            "service_account_file": "/etc/conf/awx/awx.json",
            "name": "jenkins-node-1",
            "zone": "europe-north1-a",
            "service_account_email": null,
            "disks": [
                {
                    "index": null,
                    "auto_delete": true,
                    "boot": true,
                    "device_name": null,
                    "source": null,
                    "mode": null,
                    "interface": null,
                    "initialize_params": {
                        "disk_type": null,
                        "source_image_encryption_key": null,
                        "source_image": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20191014",
                        "disk_name": null,
                        "disk_size_gb": null
                    },
                    "type": null,
                    "disk_encryption_key": null
                }
            ],
            "project": "geocitizen-app",
            "state": "present",
            "min_cpu_platform": null,
            "auth_kind": "serviceaccount",
            "label_fingerprint": null,
            "metadata": null
        }
    },
    "changed": false,
    "msg": "Please install the google-auth library"
}


Вроде бы все логично. Пишет "msg": "Please install the google-auth library". Выше нам написали, что наши библиотеки лежат тут
ansible python module location = /usr/lib/python2.7/site-packages/ansible
Вот что у нас в этой папке
[root@awx ansible]$ pwd
/usr/lib/python2.7/site-packages/ansible
[root@awx ansible]$ ls
bin                         galaxy                             pyasn1-0.4.7.dist-info
cachetools                  google                             pyasn1_modules
cachetools-3.1.1.dist-info  google_auth-1.6.3.dist-info        pyasn1_modules-0.2.7.dist-info
cli                         google_auth-1.6.3-py3.5-nspkg.pth  release.py
compat                      __init__.py                        release.pyc
config                      __init__.pyc                       release.pyo
constants.py                __init__.pyo                       rsa
constants.pyc               inventory                          rsa-4.0.dist-info
constants.pyo               modules                            six-1.12.0.dist-info
context.py                  module_utils                       six.py
context.pyc                 parsing                            six.pyc
context.pyo                 playbook                           template
errors                      plugins                            utils
executor                    pyasn1                             vars

Для чистоты эксперимента попробуем установить туда его.
[root@awx ansible]$ sudo pip install --target=/usr/lib/python2.7/site-packages/ansible google-auth

Простите что картинкой, уперся в лимит символов в вопросе
5dc04f6f16f22515900853.png


Видим что он там уже есть. Но почему тогда AWX упорно на него не смотрит?
  • Вопрос задан
  • 264 просмотра
Пригласить эксперта
Ответы на вопрос 1
@Nikobraz
Сис.админ
Зайди в Jobs, в любую джобу и посмотри значение ENVIRONMENT
И надо ставить туда
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы