aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-12-05 11:27:32 +0100
committerbinary <me@rgoncalves.se>2020-12-05 11:27:32 +0100
commite7c814241c3d67f6a39f635e39e9035b04bf77be (patch)
tree971edca139ce149b83b0a527a106036043ba29f6
parent10146429f96478f8f243727d7cdb23a3fd9e046d (diff)
downloadinfrastructure-e7c814241c3d67f6a39f635e39e9035b04bf77be.tar.gz
Use only one disk
-rw-r--r--host_vars/stack0.yml9
-rw-r--r--roles/vmm/tasks/disks.yml9
2 files changed, 6 insertions, 12 deletions
diff --git a/host_vars/stack0.yml b/host_vars/stack0.yml
index a135358..688f048 100644
--- a/host_vars/stack0.yml
+++ b/host_vars/stack0.yml
@@ -17,22 +17,19 @@ vms:
image: alpine
memory: 8G
cpu: 4
- disks:
- - { id: 0, size: "16G" }
+ disk: "16G"
- name: vm1
image: alpine
memory: 4G
cpu: 2
- disks:
- - { id: 0, size: "16G" }
+ disk: "16G"
- name: vm2
image: openbsd
memory: 4G
cpu: 2
- disks:
- - { id: 0, size: "4G" }
+ disk: "16G"
hypervisor:
interface: bnx0
diff --git a/roles/vmm/tasks/disks.yml b/roles/vmm/tasks/disks.yml
index f70d563..3e877f9 100644
--- a/roles/vmm/tasks/disks.yml
+++ b/roles/vmm/tasks/disks.yml
@@ -10,10 +10,7 @@
- name: generate vm disk
shell: |
- disk="{{ vmm.disk_dir }}/{{ guest.name }}_{{ disk.id }}.{{ vmm.disk_format }}"
+ disk="{{ vmm.disk_dir }}/{{ guest.name }}.{{ 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
+ vmctl create -s {{ guest.disk }} "${disk}"
+ when: not st.stat.exists or st.stat.size < 32
remember that computers suck.