mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 23:31:25 -07:00
Adds support for creating GCE persistent disks from snapshots
This commit is contained in:
parent
0b45b1256d
commit
d227330a55
6 changed files with 183 additions and 7 deletions
|
@ -98,6 +98,12 @@ if __name__ == '__main__':
|
|||
try:
|
||||
# Delete matching instances
|
||||
delete_gce_resources(gce.list_nodes, 'name', opts)
|
||||
# Delete matching snapshots
|
||||
def get_snapshots():
|
||||
for volume in gce.list_volumes():
|
||||
for snapshot in gce.list_volume_snapshots(volume):
|
||||
yield snapshot
|
||||
delete_gce_resources(get_snapshots, 'name', opts)
|
||||
# Delete matching disks
|
||||
delete_gce_resources(gce.list_volumes, 'name', opts)
|
||||
except KeyboardInterrupt, e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue