我正在尝试从Ansible中的gce模块创建一个Ubuntu机器,我可以创建一个debian-7机器,而不会出现以下的问题(将图像更改为"debian-7“):
- name: Create Compute Engine instances
hosts: local
gather_facts: no
connection: local
vars:
names: webserver-sr01
machine_type: n1-standard-1
image: ubuntu-1404
zone: us-central1-a
email: 12345678-longhash@developer.gserviceaccount.com
pid: fakeproj
pem: ~/Certs/somthing.pem
tasks:
- name: Launch instances
gce:
instance_names: "{{ names }}"
machine_type: "{{ machine_type }}"
image: "{{ image }}"
service_account_email: "{{ email }}"
pem_file: "{{ pem }}"
project_id: "{{ pid }}"
tags: docker-pubzilla-ws
register: gce发布于 2014-12-23 03:30:43
大约3周前,我真的遇到了同样的问题。我猜您安装了libcloud库的发行版,这正是问题所在。这是因为发行版还没有对ubuntu的支持,正如开发版本所做的那样:
https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/gce.py
在上面的文件中搜索"ubuntu“,您将看到检查它的条件。如果您将其与本地的gce.py文件进行比较,对于我来说,
/usr/local/lib/python2.7/dist-packages/libcloud/comput/drivers/gce.py你就会发现那个乌本图不在那里。
为了解决这个问题,您需要安装开发版本,具体如下所示:
https://libcloud.apache.org/getting-started.html
这在很大程度上包括:
pip install git+https://git-wip-us.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloudpip可能会检测到您已经安装了libcloud,因此您可能需要首先删除当前版本。
发布于 2015-02-13 23:57:11
与其提供图像的名称,不如为图像提供完整的url。你有:
image: ubuntu-1404改为:
image: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20150128发布于 2015-08-09 09:29:39
您可以使用云sdk中提到的图像名称,这些名称是:
https://stackoverflow.com/questions/27605262
复制相似问题