From 91cd5480b5a1ca1103d5e239af3d331477c41c2c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 21 Nov 2017 22:28:39 +0100 Subject: initial commit as copy from helsinki ansible repo --- roles/vm-install/templates/libvirt-domain.xml.j2 | 70 ++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 roles/vm-install/templates/libvirt-domain.xml.j2 (limited to 'roles/vm-install/templates/libvirt-domain.xml.j2') diff --git a/roles/vm-install/templates/libvirt-domain.xml.j2 b/roles/vm-install/templates/libvirt-domain.xml.j2 new file mode 100644 index 00000000..c95019eb --- /dev/null +++ b/roles/vm-install/templates/libvirt-domain.xml.j2 @@ -0,0 +1,70 @@ + + {{ inventory_hostname }} + {{ vm_install.mem * 1024 }} + {{ vm_install.mem * 1024 }} + {{ vm_install.numcpu }} + + hvm +{% if run_installer %} + /home/rhadmin/installer/{{ vmdistro }}/{{ vm_install.arch | default('amd64') }}/linux + /home/rhadmin/installer/{{ vmdistro }}/{{ vm_install.arch | default('amd64') }}/initrd.gz + console=ttyS0,115200n8 auto=true interface=auto url=http://ansible.helsinki.at/preseed/vm-{{ inventory_hostname }}-{{ vmdistro }}.cfg netcfg/choose_interface=enp1s1 netcfg/disable_autoconfig=true netcfg/get_ipaddress={{ srv_network.internal.ip }} netcfg/get_netmask=255.255.255.0 netcfg/get_gateway=192.168.1.254 netcfg/get_nameservers=192.168.1.254 netcfg/confirm_static=true netcfg/get_hostname={{ inventory_hostname }} netcfg/get_domain=helsinki.at +{% endif %} + + + + + + + + + destroy +{% if run_installer %} + destroy + destroy +{% else %} + restart + restart +{% endif %} + + /usr/bin/kvm + +{% if 'virtio' in vm_install.disks %} +{% for device, lv in vm_install.disks.virtio.items() %} + + + + + +{% endfor %} +{% endif %} + +{% if 'scsi' in vm_install.disks %} + +{% for device, lv in vm_install.disks.scsi.items() %} + + + + + +{% endfor %} +{% endif %} + +{% if vm_install.interfaces %} +{% for if in vm_install.interfaces %} + + + +
+ +{% endfor %} +{% endif %} + + + + + + + + + -- cgit v1.2.3