gce_pd - utilize GCE persistent disk resources

Author:Eric Johnson <erjohnso@google.com>

Synopsis

New in version 1.4.

This module can create and destroy unformatted GCE persistent disks https://developers.google.com/compute/docs/disks#persistentdisks. It also supports attaching and detaching disks from running instances but does not support creating boot disks from images or snapshots. The ‘gce’ module supports creating instances with boot disks. Full install/configuration instructions for the gce* modules can be found in the comments of ansible/test/gce_tests.py.

Options

parameter required default choices comments
detach_only no no
  • yes
  • no
do not destroy the disk, merely detach it from an instance
instance_name no
    instance name if you wish to attach or detach the disk
    mode no READ_ONLY
    • READ_WRITE
    • READ_ONLY
    GCE mount mode of disk, READ_ONLY (default) or READ_WRITE
    name yes
      name of the disk
      size_gb no 10
        whole integer size of disk (in GB) to create, default is 10 GB
        state no present
        • active
        • present
        • absent
        • deleted
        desired state of the persistent disk
        zone no us-central1-b
          zone in which to create the disk

          Note

          Requires libcloud

          Examples


          # Simple attachment action to an existing instance
          - local_action:
              module: gce_pd
              instance_name: notlocalhost
              size_gb: 5
              name: pd
          

          Table Of Contents

          Previous topic

          gce_net - create/destroy GCE networks and firewall rules

          Next topic

          glance_image - Add/Delete images from glance