aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/disk.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vmm/tasks/disk.yml')
-rw-r--r--roles/vmm/tasks/disk.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/vmm/tasks/disk.yml b/roles/vmm/tasks/disk.yml
new file mode 100644
index 0000000..24dd491
--- /dev/null
+++ b/roles/vmm/tasks/disk.yml
@@ -0,0 +1,15 @@
+- name: create disks
+ command:
+ cmd: vmctl create -s "{{ item.size }}" "{{ item.name }}.{{ vmm_disk_format }}"
+ chdir: "{{ vmm_disk_dir }}"
+ loop: "{{ __vms }}"
+ register: result
+ changed_when: result.rc == 0
+ failed_when:
+ - result.rc != 0
+ - "'File exists' not in result.stderr"
+
+- name: retrieve existing disks
+ find:
+ path: "{{ vmm_disk_dir }}"
+ patterns: "*.{{ vmm_disk_format }}"
remember that computers suck.