我使用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 }}"
我做错了什么?
答案 0 :(得分:0)
所以问题是我在寻找主机。我通过docker安装AWX,因此需要查看我的docker容器。