From 32e38e331472f5e7b695507a26f418270fed03c2 Mon Sep 17 00:00:00 2001 From: donotos Date: Fri, 9 Feb 2024 08:33:08 +0100 Subject: [PATCH 1/2] create vmware_check_snapshot.yml --- vmware_check_snapshot.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 vmware_check_snapshot.yml diff --git a/vmware_check_snapshot.yml b/vmware_check_snapshot.yml new file mode 100644 index 0000000..b7ba7c8 --- /dev/null +++ b/vmware_check_snapshot.yml @@ -0,0 +1,15 @@ +--- +- name: Get Snapshot infos. + hosts: all + + tasks: + + - name: Gather snapshot information about the virtual machine in the given vCenter + community.vmware.vmware_guest_snapshot_info: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + datacenter: "{{ datacenter_name }}" + uuid: "{{ vm_uuid }}" + delegate_to: localhost + register: snapshot_info \ No newline at end of file From 75e3c10bbbc99dc3e1fb5c504a9497acc0763c3c Mon Sep 17 00:00:00 2001 From: donotos Date: Fri, 9 Feb 2024 09:08:05 +0100 Subject: [PATCH 2/2] Update vmware_check_snapshot.yml --- vmware_check_snapshot.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/vmware_check_snapshot.yml b/vmware_check_snapshot.yml index b7ba7c8..9c0f9eb 100644 --- a/vmware_check_snapshot.yml +++ b/vmware_check_snapshot.yml @@ -3,13 +3,12 @@ hosts: all tasks: - - - name: Gather snapshot information about the virtual machine in the given vCenter - community.vmware.vmware_guest_snapshot_info: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - datacenter: "{{ datacenter_name }}" - uuid: "{{ vm_uuid }}" - delegate_to: localhost - register: snapshot_info \ No newline at end of file + - name: Gather snapshot information about the virtual machine in the given vCenter + community.vmware.vmware_guest_snapshot_info: + hostname: "{{ lookup('env', 'VMWARE_HOST') }}" + username: "{{ lookup('env', 'VMWARE_USER') }}" + password: "{{ lookup('env', 'VMWARE_PASSWORD') }}" + datacenter: "{{ esxi_host }}" + uuid: "{{ vm_uuid }}" + delegate_to: localhost + register: snapshot_info \ No newline at end of file