ansible: Add option to template libvirt domains with EFI
authorKienan Stewart <kstewart@efficios.com>
Thu, 11 Jul 2024 19:36:53 +0000 (15:36 -0400)
committerKienan Stewart <kstewart@efficios.com>
Thu, 11 Jul 2024 20:12:43 +0000 (16:12 -0400)
Change-Id: I3f706634c81a193132b93cfc7b6cbae6ac795157
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
automation/ansible/roles/libvirt/templates/vm_template.xml.j2
automation/ansible/roles/libvirt/vars/main.yml

index 3313f307b423fc728b705bf97a1f54c8c37a3d85..495a6f0999ae5d36675209e3ca0c6fe95a044a60 100644 (file)
@@ -7,6 +7,10 @@
   <vcpu placement='static'>{{ vm.vcpu }}</vcpu>
   <os>
     <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
+    {% if 'efi' in vm and vm.efi %}
+    <loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE_4M.fd</loader>
+    <nvram>/var/lib/libvirt/qemu/nvram/{% vm.name %}_VARS.fd</nvram>
+    {% endif %}
     <bootmenu enable='yes'/>
   </os>
   <features>
       <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
     </rng>
   </devices>
-</domain>
\ No newline at end of file
+</domain>
index d9882853a6b53cda335d4c7d2c07b2c0eec701ad..2dbd01dd4f3edb172dc176449bd64d0b8f79d8d5 100644 (file)
@@ -7,8 +7,10 @@ vm_defaults:
   net_bridge: 'br102'
   # Non-default keys
   # cdrom: /path/to/file.iso
-  # uuid: xxxx-yyyy
+  # efi: true/false
   # name: xyz
+  # uuid: xxxx-yyyy
+
 isos:
   - url: https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso
     checksum: "sha256:45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2"
This page took 0.024566 seconds and 4 git commands to generate.