diff options
Diffstat (limited to 'ansible/deployment_poc/templates')
3 files changed, 195 insertions, 0 deletions
diff --git a/ansible/deployment_poc/templates/dhcpd.conf.j2 b/ansible/deployment_poc/templates/dhcpd.conf.j2 new file mode 100644 index 0000000..5309ae4 --- /dev/null +++ b/ansible/deployment_poc/templates/dhcpd.conf.j2 @@ -0,0 +1,5 @@ +host {{ vm_name }} { + hardware ethernet {{ mac_address }}; + fixed-address {{ ip_address }}; + filename "replace-with-bootfile"; +} diff --git a/ansible/deployment_poc/templates/libvirt-storage-template.xml.j2 b/ansible/deployment_poc/templates/libvirt-storage-template.xml.j2 new file mode 100644 index 0000000..9ce3ff1 --- /dev/null +++ b/ansible/deployment_poc/templates/libvirt-storage-template.xml.j2 @@ -0,0 +1,16 @@ +<volume type='file'> + <name>{{ inventory_hostname }}_root_disk.qcow2</name> + <source> + </source> + <capacity unit='GB'>{{ disk }}</capacity> + <target> + <path>{{ storage.name }}</path> + <format type='qcow2'/> + <permissions> + <mode>0660</mode> + <owner>107</owner> + <group>107</group> + </permissions> + </target> +</volume> + diff --git a/ansible/deployment_poc/templates/libvirt-template.xml.j2 b/ansible/deployment_poc/templates/libvirt-template.xml.j2 new file mode 100644 index 0000000..8c4170d --- /dev/null +++ b/ansible/deployment_poc/templates/libvirt-template.xml.j2 @@ -0,0 +1,174 @@ +<domain type='kvm'> + <name>{{ inventory_hostname }}</name> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + </libosinfo:libosinfo> + </metadata> + <memory unit='MB'>{{ memory }}</memory> + <currentMemory unit='GB'>{{ memory }}</currentMemory> + <vcpu placement='static'>{{ vcpus }}</vcpu> + <resource> + <partition>/machine</partition> + </resource> + <os> + <type arch='x86_64' machine='pc-q35-5.2'>hvm</type> + <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x86_64-code.bin</loader> + <nvram>/var/lib/libvirt/qemu/nvram/{{ inventory_hostname }}_VARS.fd</nvram> + <bootmenu enable='no'/> + </os> + <features> + <acpi/> + <apic/> + <vmport state='off'/> + </features> + <cpu mode='custom' match='exact' check='full'> + <model fallback='forbid'>Broadwell-IBRS</model> + <vendor>Intel</vendor> + <feature policy='require' name='vme'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='f16c'/> + <feature policy='require' name='rdrand'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='arat'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='umip'/> + <feature policy='require' name='md-clear'/> + <feature policy='require' name='stibp'/> + <feature policy='require' name='arch-capabilities'/> + <feature policy='require' name='ssbd'/> + <feature policy='require' name='xsaveopt'/> + <feature policy='require' name='pdpe1gb'/> + <feature policy='require' name='abm'/> + <feature policy='require' name='skip-l1dfl-vmentry'/> + <feature policy='require' name='pschange-mc-no'/> + </cpu> + <clock offset='utc'> + <timer name='rtc' tickpolicy='catchup'/> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet' present='no'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <pm> + <suspend-to-mem enabled='no'/> + <suspend-to-disk enabled='no'/> + </pm> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <!--disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/mnt/arr1-store1/vmstore1/{{ inventory_hostname }}_root_disk.qcow2' index='2'/> + <backingStore/> + <target dev='vda' bus='virtio'/> + <boot order='1'/> + <alias name='virtio-disk0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </disk--> + <!--disk type='file' device='cdrom'> + <driver name='qemu'/> + <source file='/mnt/iso/openSUSE-Leap-15.3-NET-x86_64.iso'/> + <target dev='sda' bus='sata'/> + <readonly/> + <boot order='2'/> + <alias name='sata0-0-0'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk--> + <controller type='usb' index='0' model='qemu-xhci' ports='15'> + <alias name='usb'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <alias name='ide'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'> + <alias name='pcie.0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <alias name='pci.1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <alias name='pci.2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0xa'/> + <alias name='pci.3'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='4' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='4' port='0xb'/> + <alias name='pci.4'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/> + </controller> + <controller type='pci' index='5' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='5' port='0xc'/> + <alias name='pci.5'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/> + </controller> + <controller type='pci' index='6' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='6' port='0xd'/> + <alias name='pci.6'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> + </controller> + <controller type='pci' index='7' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='7' port='0xe'/> + <alias name='pci.7'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x6'/> + </controller> + <controller type='virtio-serial' index='0'> + <alias name='virtio-serial0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> + <interface type='network'> + <source network='LAN01'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </interface> + <serial type='pty'> + <source path='/dev/pts/4'/> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + <alias name='serial0'/> + </serial> + <console type='pty' tty='/dev/pts/4'> + <source path='/dev/pts/4'/> + <target type='serial' port='0'/> + <alias name='serial0'/> + </console> + <channel type='unix'> + <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <input type='mouse' bus='ps2'> + <alias name='input0'/> + </input> + <input type='keyboard' bus='ps2'> + <alias name='input1'/> + </input> + <memballoon model='virtio'> + <alias name='balloon0'/> + <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <alias name='rng0'/> + <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/> + </rng> + </devices> +</domain> + |