W3cubDocs

/Ansible

gce_img - utilize GCE image resources

New in version 1.9.

Synopsis

This module can create and delete GCE private images from gzipped compressed tarball containing raw disk data or from existing detached disks in any zone. https://cloud.google.com/compute/docs/images

Requirements (on host that executes module)

  • python >= 2.6
  • apache-libcloud

Options

parameter required default choices comments
description
no
an optional description
family
(added in 2.2)
no
an optional family name
name
yes
the name of the image to create or delete
pem_file
no
path to the pem file associated with the service account email
project_id
no
your GCE project ID
service_account_email
no
service account email
source
no
the source disk or the Google Cloud Storage URI to create the image from
state
no present
  • present
  • absent
desired state of the image
timeout
(added in 2.0)
no 180
timeout for the operation
zone
no us-central1-a
the zone of the disk specified by source

Examples

# Create an image named test-image from the disk 'test-disk' in zone us-central1-a.
- gce_img:
    name: test-image
    source: test-disk
    zone: us-central1-a
    state: present

# Create an image named test-image from a tarball in Google Cloud Storage.
- gce_img:
    name: test-image
    source: https://storage.googleapis.com/bucket/path/to/image.tgz

# Alternatively use the gs scheme
- gce_img:
    name: test-image
    source: gs://bucket/path/to/image.tgz

# Delete an image named test-image.
- gce_img:
    name: test-image
    state: absent

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/gce_img_module.html