aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/disks.yml
blob: 3e877f97f7d2c118d2be770d282b526271e2ec90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 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 }}.{{ vmm.disk_format }}"
    rm "${disk}"
    vmctl create -s {{ guest.disk }} "${disk}"
  when: not st.stat.exists or st.stat.size < 32
remember that computers suck.