0

我使用 AWX 8.0.0.0。在我的 SCM 上有工作,该工作连接到 GCP 并创建实例。当我在控制台下运行这项工作时,ansible-playbook job.yml它做得很好。但是当我从 Web UI 运行它时,我得到了错误

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Please install the google-auth library"} 所以它不经意意味着我没有这个图书馆。但是我安装它 pip install google-auth并且当我从控制台运行它时它工作正常。这是我的剧本:

- name: Create jenkins vm
  hosts: localhost
  connection: local
  gather_facts: no
  vars:
    service_account_email: ansible@secret-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 }}"

我做错了什么?

4

1 回答 1

0

所以问题是我在看我的主机。我通过 docker 安装 AWX,所以我需要查看我的 docker 容器。

于 2019-11-12T11:49:23.653 回答