Add support for datadisk type

This commit is contained in:
Timo Makinen 2022-08-13 17:34:34 +00:00
parent 4de72ed215
commit b1036de33d
20 changed files with 40 additions and 31 deletions

View file

@ -11,7 +11,6 @@
console_log: "/var/log/libvirt/qemu/{{ inventory_hostname }}.console.log"
os_disk_image: "/srv/libvirt/ssd/{{ inventory_hostname }}.a.img"
dsk_opts: bus=virtio,cache=none,device=disk,format=raw
base: /srv/libvirt/hdd/{{ inventory_hostname }}
inject: >-
{% if not '--cdrom' in virt_install_os_args %}{{ true }}{% endif %}
@ -19,7 +18,13 @@
virt_install_disks: >-
{% if datadisks is defined %}
{% for i in range(datadisks|count) %}
--disk {{ base }}.{{ char[i] }}.img,{{ dsk_opts }},size={{ datadisks[i] }},sparse=no
{% if datadisks[i].type is defined %}
{% set type = datadisks[i].type %}
{% else %}
{% set type = "hdd" %}
{% endif %}
{% set base = "/srv/libvirt/" + type + "/" + inventory_hostname %}
--disk {{ base }}.{{ char[i] }}.img,{{ dsk_opts }},size={{ datadisks[i].size }},sparse=no
{% endfor %}
{% endif %}

View file

@ -9,10 +9,19 @@
vars_files:
- "{{ ansible_private }}/vars.yml"
pre_tasks:
- name: mount /export
- name: mount /export/home
mount:
name: /export
src: LABEL=/export
name: /export/home
src: LABEL=home
fstype: xfs
opts: noatime
passno: "0"
dump: "0"
state: mounted
- name: mount /export/roles
mount:
name: /export/roles
src: LABEL=roles
fstype: xfs
opts: noatime
passno: "0"