summaryrefslogtreecommitdiff
path: root/roles/vm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-04 17:07:19 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-04 17:07:19 +0200
commitc0aabbde47b8a423c8d1f622ac579fa0a884f6d2 (patch)
treed42d349c601d729219ab6dc41e7fd0c25c931b76 /roles/vm
parentport elevate/media role to new storage volume roles (diff)
port vm/host/base role to new storage volume roles
Diffstat (limited to 'roles/vm')
-rw-r--r--roles/vm/host/base/tasks/main.yml40
1 files changed, 13 insertions, 27 deletions
diff --git a/roles/vm/host/base/tasks/main.yml b/roles/vm/host/base/tasks/main.yml
index f789d2e0..0a1f2182 100644
--- a/roles/vm/host/base/tasks/main.yml
+++ b/roles/vm/host/base/tasks/main.yml
@@ -2,13 +2,13 @@
- name: install dependencies
apt:
name:
- - qemu-kvm
- - # configuration package, pulls in libvirt-clients and libvirt-daemon
- libvirt-daemon-system
- - "{{ python_basename }}-libvirt"
- - haveged
- - bridge-utils
- - acl
+ - qemu-kvm
+ - # configuration package, pulls in libvirt-clients and libvirt-daemon
+ libvirt-daemon-system
+ - "{{ python_basename }}-libvirt"
+ - haveged
+ - bridge-utils
+ - acl
state: present
- name: configure haveged
@@ -22,26 +22,12 @@
when: "'zfs' in vm_host"
include_tasks: zfs.yml
-- name: create lvm-based disk for installers
- when: installer_lvm is defined
- block:
- - name: create logical volume
- lvol:
- vg: "{{ installer_lvm.vg }}"
- lv: "{{ installer_lvm.lv }}"
- size: "{{ installer_lvm.size }}"
-
- - name: create filesystem
- filesystem:
- fstype: "{{ installer_lvm.fs }}"
- dev: "/dev/mapper/{{ installer_lvm.vg | replace('-', '--') }}-{{ installer_lvm.lv | replace('-', '--') }}"
-
- - name: mount filesytem
- mount:
- src: "/dev/mapper/{{ installer_lvm.vg | replace('-', '--') }}-{{ installer_lvm.lv | replace('-', '--') }}"
- path: "{{ installer_base_path }}"
- fstype: "{{ installer_lvm.fs }}"
- state: mounted
+- name: prepare storage volume for installers
+ when: installer_storage is defined
+ vars:
+ storage_volume: "{{ installer_storage | combine({'dest': installer_base_path}) }}"
+ include_role:
+ name: "storage/{{ installer_storage.type }}/volume"
- name: make sure installer directory exists
file: