Skip to content

Commit df20847

Browse files
Merge pull request #173 from ScaleComputing/virtual-disk-info-example
Add example for virtual_disk_info module
2 parents e112d64 + 563c893 commit df20847

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

examples/virtual_disk_info.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
- name: Example virtual_disk_info module
3+
hosts: localhost
4+
connection: local
5+
gather_facts: false
6+
vars:
7+
# Source http link:
8+
# https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
9+
virtual_disk_name: focal-server-cloudimg-amd64.img
10+
11+
tasks:
12+
# ------------------------------------------------------
13+
- name: List all virtual disks
14+
scale_computing.hypercore.virtual_disk_info:
15+
register: virtual_disk_results
16+
17+
- name: Show all virtual disks
18+
debug:
19+
var: virtual_disk_results
20+
21+
# ------------------------------------------------------
22+
- name: Get info about specific virtual disk - {{ virtual_disk_name }}
23+
scale_computing.hypercore.virtual_disk_info:
24+
name: "{{ virtual_disk_name }}"
25+
register: virtual_disk_results
26+
27+
- name: Show info about single virtual disk
28+
debug:
29+
var: virtual_disk_results
30+
31+
# ------------------------------------------------------
32+
- name: Get info about not present virtual disk
33+
scale_computing.hypercore.virtual_disk_info:
34+
name: no-such-virtual-disk-20sb9uagwa3.iso
35+
register: virtual_disk_results
36+
37+
- name: Show info about absent virtual disk
38+
debug:
39+
var: virtual_disk_results

0 commit comments

Comments
 (0)