From e3d0be5df3a8a43b19da0bb814c8174048cfc79f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 6 Jan 2022 19:22:14 +0100 Subject: split up vm/define into remove and create --- .../guest/create/templates/libvirt-domain.xml.j2 | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 roles/vm/guest/create/templates/libvirt-domain.xml.j2 (limited to 'roles/vm/guest/create/templates/libvirt-domain.xml.j2') diff --git a/roles/vm/guest/create/templates/libvirt-domain.xml.j2 b/roles/vm/guest/create/templates/libvirt-domain.xml.j2 new file mode 100644 index 00000000..96b12a74 --- /dev/null +++ b/roles/vm/guest/create/templates/libvirt-domain.xml.j2 @@ -0,0 +1,96 @@ + + {{ inventory_hostname }} + {{ ((install.vm.memory | human_to_bytes) / 1024) | int }} + {{ ((install.vm.memory | human_to_bytes) / 1024) | int }} + {{ install.vm.numcpus }} + + hvm +{% if vm_create_installer %} +{% if install_distro == 'debian' or install_distro == 'ubuntu' %} + {{ installer_tmpdir }}/linux + {{ installer_tmpdir }}/initrd.gz + console=ttyS0,115200n8 auto + +{% elif install_distro == 'openbsd' %} + +{% endif %} +{% else %} + +{% endif %} + + + + + + + + destroy +{% if vm_create_installer %} + destroy + destroy +{% else %} + restart + restart +{% endif %} + + /usr/bin/kvm + + + + + /dev/random + + +{% if vm_create_installer and install_distro == 'openbsd' %} + + + + + + + +{% endif %} +{% if install.disks %} +{% if 'scsi' in install.disks %} + +{% endif %} +{% for bus in ['virtio', 'scsi'] %} +{% for device, src in (install.disks[bus] | default({})).items() %} + + +{% if src.type == 'lvm' %} + +{% elif src.type == 'zfs' %} + +{% elif src.type == 'blockdev' %} + +{% elif src.type == 'image' %} + +{% endif %} + + +{% endfor %} +{% endfor %} + +{% endif %} +{% if install.interfaces %} +{% for if in install.interfaces %} + +{% if 'mac' in if %} + +{% endif %} + + +
+ +{% endfor %} + +{% endif %} + + + + + + + + -- cgit v1.2.3