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
COMPONENT NAME
gcp_compute_region_disk
ANSIBLE VERSION
COLLECTION VERSION
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.
SUMMARY
When using the
gcp_compute_region_diskmodule with thesource_snapshotparameter, the parameter is ignored and an empty disk is created.I believe this is due to the absence of
source_snapshotfrom this modulesresource_to_requestfunction:google.cloud/plugins/modules/gcp_compute_region_disk.py
Line 508 in eec40d5
See the
gcp_compute_diskmodule, which does work:google.cloud/plugins/modules/gcp_compute_disk.py
Line 665 in eec40d5
ISSUE TYPE
COMPONENT NAME
gcp_compute_region_disk
ANSIBLE VERSION
COLLECTION VERSION
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.
EXPECTED RESULTS
A disk should be created from the specified source snapshot.
ACTUAL RESULTS
An empty disk was created, the
source_snapshotparameter is not present in the GCP resource spec.