blob: 1c444716eb3b971f77b73bf954f38194f31b5ffa (
plain) (
tree)
|
|
# vmm ~~ tasks/generate_disk.yml
---
- name: Check existence of disk directory
file:
path: "{{ vmm.disk_dir }}"
state: directory
- name: Get existing disk file size
stat:
path: "{{ vmm.disk_dir }}/{{ guest.name }}.{{ vmm.disk_format }}"
register: st
- name: Generate vm disk for {{ guest.name }}
shell: |
disk="{{ vmm.disk_dir }}/{{ guest.name }}.{{ vmm.disk_format }}"
rm "${disk}"
vmctl create -s {{ guest.size }} "${disk}"
when: not st.stat.exists or st.stat.size < 32
|