aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/disk.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-06 20:10:25 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-07 20:24:51 +0000
commit333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6 (patch)
tree1f06800c26e23bb272af02d45fe4d73f4f2a091e /roles/vmm/tasks/disk.yml
parent4e542a8e15596421a9120cf700f0d4d12dbf6688 (diff)
downloadrules-333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6.tar.gz
roles/vmm: Setup and create vms on openbsd
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.