-
Notifications
You must be signed in to change notification settings - Fork 4
/
acronis_splinkdeletesnaps.yml
29 lines (26 loc) · 1.16 KB
/
acronis_splinkdeletesnaps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
- name: delete orphaned acronis vsds #edit vmname variable - use -l filter to specify cluster vs. full inventory
hosts: edge
vars:
- vmname: PM-SPLUNK
connection: local
gather_facts: false
strategy: host_pinned # free #allows each cluster to start next task before all clusters have finished current task
environment: #if set here - hypercore modules will automatically use this for each remote cluster - avoiding need to specify cluster_instance for each test
SC_HOST: "https://{{ inventory_hostname }}"
SC_USERNAME: "{{ scale_user | default('admin') }}"
SC_PASSWORD: "{{ scale_pass | default('admin') }}"
SC_TIMEOUT: 60
tasks:
- name: List all snapshots
scale_computing.hypercore.vm_snapshot_info:
vm_name: "{{ vmname }}"
register: snapshot_results
- name: Loop through list of snapshots and delete all older than the 'use_date'
scale_computing.hypercore.vm_snapshot:
vm_name: "{{ item.vm.name }}"
uuid: "{{ item.snapshot_uuid }}"
state: absent
loop: "{{ snapshot_results.records }}"
ignore_errors: true
#TODO - could evaulate name for Acronis utility snapshot