community.general.gce_pd (0.1.4) — module

utilize GCE persistent disk resources

Authors: Eric Johnson (@erjohnso) <erjohnso@google.com>

Install collection

Install with ansible-galaxy collection install community.general:==0.1.4


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.4

Description

This module can create and destroy unformatted GCE persistent disks U(https://developers.google.com/compute/docs/disks#persistentdisks). It also supports attaching and detaching disks from running instances. Full install/configuration instructions for the gce* modules can be found in the comments of ansible/test/gce_tests.py.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Simple attachment action to an existing instance
  local_action:
    module: gce_pd
    instance_name: notlocalhost
    size_gb: 5
    name: pd

Inputs

    
mode:
    choices:
    - READ_WRITE
    - READ_ONLY
    default: READ_ONLY
    description:
    - GCE mount mode of disk, READ_ONLY (default) or READ_WRITE

name:
    description:
    - name of the disk
    required: true

zone:
    default: us-central1-b
    description:
    - zone in which to create the disk

image:
    description:
    - the source image to use for the disk

state:
    choices:
    - active
    - present
    - absent
    - deleted
    default: present
    description:
    - desired state of the persistent disk

size_gb:
    default: 10
    description:
    - whole integer size of disk (in GB) to create, default is 10 GB

pem_file:
    description:
    - path to the pem file associated with the service account email This option is deprecated.
      Use 'credentials_file'.

snapshot:
    description:
    - the source snapshot to use for the disk

disk_type:
    choices:
    - pd-standard
    - pd-ssd
    default: pd-standard
    description:
    - type of disk provisioned

project_id:
    description:
    - your GCE project ID

detach_only:
    default: 'no'
    description:
    - do not destroy the disk, merely detach it from an instance
    type: bool

instance_name:
    description:
    - instance name if you wish to attach or detach the disk

credentials_file:
    description:
    - path to the JSON file associated with the service account email

delete_on_termination:
    default: 'no'
    description:
    - If C(yes), deletes the volume when instance is terminated
    type: bool

service_account_email:
    description:
    - service account email