diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-06 20:10:25 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-07 20:24:51 +0000 |
commit | 333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6 (patch) | |
tree | 1f06800c26e23bb272af02d45fe4d73f4f2a091e /roles/vmm/tasks/disk.yml | |
parent | 4e542a8e15596421a9120cf700f0d4d12dbf6688 (diff) | |
download | rules-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.yml | 15 |
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 }}" |