- Docs »
- gce_img - utilize GCE image resources
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
gce_img - utilize GCE image resources
The below requirements are needed on the host that executes this module.
- python >= 2.6
- apache-libcloud
Parameter |
Choices/Defaults |
Comments |
description
|
|
an optional description
|
family
(added in 2.2) |
|
an optional family name
|
name
required |
|
the name of the image to create or delete
|
pem_file
|
|
path to the pem file associated with the service account email
|
project_id
|
|
your GCE project ID
|
service_account_email
|
|
service account email
|
source
|
|
the source disk or the Google Cloud Storage URI to create the image from
|
state
|
Choices:
present ←
- absent
|
desired state of the image
|
timeout
(added in 2.0) |
Default:
180
|
timeout for the operation
|
zone
|
Default:
"us-central1-a"
|
the zone of the disk specified by source
|
# 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 module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.