From 9b8685884d173d937a8f2d19b2206d67f95b95d0 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Thu, 11 Jul 2024 15:36:53 -0400 Subject: [PATCH] ansible: Add option to template libvirt domains with EFI Change-Id: I3f706634c81a193132b93cfc7b6cbae6ac795157 Signed-off-by: Kienan Stewart --- .../ansible/roles/libvirt/templates/vm_template.xml.j2 | 6 +++++- automation/ansible/roles/libvirt/vars/main.yml | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 b/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 index 3313f30..495a6f0 100644 --- a/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 +++ b/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 @@ -7,6 +7,10 @@ {{ vm.vcpu }} hvm + {% if 'efi' in vm and vm.efi %} + /usr/share/OVMF/OVMF_CODE_4M.fd + /var/lib/libvirt/qemu/nvram/{% vm.name %}_VARS.fd + {% endif %} @@ -152,4 +156,4 @@
- \ No newline at end of file + diff --git a/automation/ansible/roles/libvirt/vars/main.yml b/automation/ansible/roles/libvirt/vars/main.yml index d988285..2dbd01d 100644 --- a/automation/ansible/roles/libvirt/vars/main.yml +++ b/automation/ansible/roles/libvirt/vars/main.yml @@ -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" -- 2.34.1