Open smemsh opened 3 years ago
gcp_compute_disk_info
returns a list of matched disks, in your case it will have only one element, so I guess changing the gcp_compute_snapshot
task to below can help:
- name: snapshot_dev_disk
gcp_compute_snapshot:
name: '{{snapname}}'
source_disk: '{{srcdisk.resources | first}}'
# ...
register: snapdisk
It's possible that's the issue @shamil, but the reproduction environment is no longer available to me. Do you know this works for you with the method described? It makes sense, but would be puzzling, because it actually worked sometimes for me as written, when testing repeatedly (but most of the time did not). I will test it with your suggestion at some future point if you haven't already.
SUMMARY
when
gcp_compute_disk_info
is used to obtain a source disk and then given togcp_compute_snapshot
, the snapshot usually fails with:it seems to only work if supplied using
name
dictionary instead of the registered variable. This contradicts the documentation:The second way usually does not work. Note that it sometimes worked during testing, about 1/10 times it would work. I can't explain this, but providing the
name
dict only (first method from docs) seemed to work every time.ISSUE TYPE
COMPONENT NAME
gcp_compute_snapshot
ANSIBLE VERSION
CONFIGURATION
stock
OS / ENVIRONMENT
linux
STEPS TO REPRODUCE