From 333eff6a0aeefcbf573bbf5e725fc27b5b4cb9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 6 Dec 2021 20:10:25 +0000 Subject: roles/vmm: Setup and create vms on openbsd --- roles/vmm/tasks/disk.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 roles/vmm/tasks/disk.yml (limited to 'roles/vmm/tasks/disk.yml') 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 }}" -- cgit v1.2.3