-
Notifications
You must be signed in to change notification settings - Fork 4
/
vm_snapshot_info.yml
44 lines (36 loc) · 1.26 KB
/
vm_snapshot_info.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: Test vm_snapshot_info
hosts: all
become: false
gather_facts: false
connection: ansible.builtin.local
strategy: host_pinned
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 }}"
SC_PASSWORD: "{{ scale_pass }}"
SC_TIMEOUT: 600
tasks:
- name: get vm info
scale_computing.hypercore.vm_info:
register: vm
- name: debug
debug:
var: vm
- name: get snapshot info
scale_computing.hypercore.vm_snapshot_info:
register: snapshot
- name: debug
debug:
var: snapshot
# - name: Convert snapshot data to CSV format
# set_fact:
# snapshot_csv: "{{ snapshot.records | map('json_query', '{label: label, vm_name: vm_name, snapshot_uuid: snapshot_uuid}') | list | map('to_json') | join('\n') }}"
# - name: Write snapshot data to a CSV file
# copy:
# content: "{{ snapshot_csv }}"
# dest: "snapshot_info.csv"
# - name: Write snapshot data to a JSON file
# copy:
# content: "{{ snapshot.records | to_nice_json }}"
# dest: "snapshot_info.json"