You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In module "community.vmware.vmware_guest_snapshot":
Removing a snapshot is done by the snapshot name.
If there are multiple snapshots with the same name, and not ALL need to be removed, there is no way to differentiate them from one another.
ISSUE TYPE
Add a new parameter "snapshot_id" to the "community.vmware.vmware_guest_snapshot" module which will be used to select a unique snapshot.
COMPONENT NAME
community.vmware.vmware_guest_snapshot
ADDITIONAL INFORMATION
The new parameter will be used as an alternative to "snapshot_name".
Only one of the parameters could be used, to prevent conflicts.
---
- name: create new snapshot and then delete old snapshotshosts: allgather_facts: falsetasks:
- name: Gather detailed information about tags and category associated with the given VMcommunity.vmware.vmware_guest_snapshot_info:
datacenter: "{{ datacenter_name }}"folder: "{{ path | regex_replace('^(.*)vm', '') }}"name: "{{ config.name }}"delegate_to: localhostregister: snapshots_info
- name: create new snapshotcommunity.vmware.vmware_guest_snapshot:
snapshot_name: "mySnapshot"description: "This snapshot is created by AWX"datacenter: "{{ datacenter_name }}"folder: "{{ path | regex_replace('^(.*)vm', '') }}"name: "{{ config.name }}"state: presentmemory_dump: truedelegate_to: localhost
- name: Remove only snapshots from list, community.vmware.vmware_guest_snapshot:
datacenter: "{{ datacenter_name }}"folder: "{{ path | regex_replace('^(.*)vm', '') }}"name: "{{ config.name }}"snapshot_id: "{{ item.id }}"state: absentdelegate_to: localhostloop: "{{ snapshots_info.guest_snapshots.snapshots }}"
The text was updated successfully, but these errors were encountered:
Add snapshot_id option to vmware_guest_snapshot module
SUMMARY
This PR is to add snapshot_id option to the module.
fixes: #1844
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
changelogs/fragments/1847_vmware_guest_snapshot.yml
docs/community.vmware.vmware_guest_snapshot_module.rst
plugins/modules/vmware_guest_snapshot.py
tests/integration/targets/vmware_guest_snapshot/tasks/main.yml
ADDITIONAL INFORMATION
I will add the integration test in a few days.
Done
Reviewed-by: Mario Lenz <[email protected]>
SUMMARY
In module "community.vmware.vmware_guest_snapshot":
Removing a snapshot is done by the snapshot name.
If there are multiple snapshots with the same name, and not ALL need to be removed, there is no way to differentiate them from one another.
ISSUE TYPE
COMPONENT NAME
community.vmware.vmware_guest_snapshot
ADDITIONAL INFORMATION
The new parameter will be used as an alternative to "snapshot_name".
Only one of the parameters could be used, to prevent conflicts.
The text was updated successfully, but these errors were encountered: