Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.gce_img.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| description string | an optional description | |
| family string | an optional family name | |
| name string / required | the name of the image to create or delete | |
| pem_file string | path to the pem file associated with the service account email | |
| project_id string | your GCE project ID | |
| service_account_email string | service account email | |
| source string | the source disk or the Google Cloud Storage URI to create the image from | |
| state string |
| desired state of the image |
| timeout string | Default: 180 | timeout for the operation |
| zone string | Default: "us-central1-a" | the zone of the disk specified by source |
- name: Create an image named test-image from the disk 'test-disk' in zone us-central1-a
community.general.gce_img:
name: test-image
source: test-disk
zone: us-central1-a
state: present
- name: Create an image named test-image from a tarball in Google Cloud Storage
community.general.gce_img:
name: test-image
source: https://storage.googleapis.com/bucket/path/to/image.tgz
- name: Alternatively use the gs scheme
community.general.gce_img:
name: test-image
source: gs://bucket/path/to/image.tgz
- name: Delete an image named test-image
community.general.gce_img:
name: test-image
state: absent
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/gce_img_module.html