aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/generate_disk.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vmm/tasks/generate_disk.yml')
-rw-r--r--roles/vmm/tasks/generate_disk.yml12
1 files changed, 6 insertions, 6 deletions
diff --git a/roles/vmm/tasks/generate_disk.yml b/roles/vmm/tasks/generate_disk.yml
index c8ec091..1c44471 100644
--- a/roles/vmm/tasks/generate_disk.yml
+++ b/roles/vmm/tasks/generate_disk.yml
@@ -5,17 +5,17 @@
- name: Check existence of disk directory
file:
- path: "{{ vmm.disk.dir }}"
+ path: "{{ vmm.disk_dir }}"
state: directory
- name: Get existing disk file size
stat:
- path: "{{ vmm.disk.dir }}/{{ hostvars[vm].ansible_host }}.{{ vmm.disk.format }}"
+ path: "{{ vmm.disk_dir }}/{{ guest.name }}.{{ vmm.disk_format }}"
register: st
-- name: Generate vm disk
+- name: Generate vm disk for {{ guest.name }}
shell: |
- disk="{{ vmm.disk.dir }}/{{ hostvars[vm].ansible_host }}.{{ vmm.disk.format }}"
+ disk="{{ vmm.disk_dir }}/{{ guest.name }}.{{ vmm.disk_format }}"
rm "${disk}"
- vmctl create -s {{ hostvars[vm].size }} "${disk}"
- when: not st.stat.exists or st.stat.size == 0
+ vmctl create -s {{ guest.size }} "${disk}"
+ when: not st.stat.exists or st.stat.size < 32
remember that computers suck.