Skip to content

gcp_compute_region_disk ignores source_snapshot parameter #736

@Dadavan

Description

@Dadavan
SUMMARY

When using the gcp_compute_region_disk module with the source_snapshot parameter, the parameter is ignored and an empty disk is created.
I believe this is due to the absence of source_snapshot from this modules resource_to_request function:

def resource_to_request(module):

See the gcp_compute_disk module, which does work:

u'sourceSnapshot': replace_resource_dict(module.params.get(u'source_snapshot', {}), 'selfLink'),

ISSUE TYPE
  • Bug Report
COMPONENT NAME

gcp_compute_region_disk

ANSIBLE VERSION
2.14.18
COLLECTION VERSION
1.1.3
CONFIGURATION

None changed

OS / ENVIRONMENT

Docker

STEPS TO REPRODUCE

Create a disk using the following snippet.
Inspect the created disk and see that it has no source snapshot.

  - name: Create disk
    gcp_compute_region_disk:
      project: my-project
      name: my-disk
      source_snapshot:
        selfLink: "{{ data_disk_snapshot.resources[0].selfLink }}"
      region: europe-north1
      replica_zones:
      - europe-north1-a
      - europe-north1-b
EXPECTED RESULTS

A disk should be created from the specified source snapshot.

ACTUAL RESULTS

An empty disk was created, the source_snapshot parameter is not present in the GCP resource spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions