diff options
Diffstat (limited to 'roles/vmm/tasks/disks.yml')
-rw-r--r-- | roles/vmm/tasks/disks.yml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/vmm/tasks/disks.yml b/roles/vmm/tasks/disks.yml new file mode 100644 index 0000000..f70d563 --- /dev/null +++ b/roles/vmm/tasks/disks.yml @@ -0,0 +1,19 @@ + +# disks ~~ roles/vmm/tasks/disks.yml + +--- + +- name: get existing disk file size + stat: + path: "{{ vmm.disk_dir }}/{{ guest.name }}.{{ vmm.disk_format }}" + register: st + +- name: generate vm disk + shell: | + disk="{{ vmm.disk_dir }}/{{ guest.name }}_{{ disk.id }}.{{ vmm.disk_format }}" + rm "${disk}" + vmctl create -s {{ disk.size }} "${disk}" + #when: not st.stat.exists or st.stat.size < 32 + loop: "{{ guest.disks }}" + loop_control: + loop_var: disk |