Skip to content

Add support for EFI boot mode #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ default value is `true`.
system emulators, e.g. `x86`. The default value is `['x86']` if
`libvirt_host_require_vt` is `false`, otherwise the default value is an empty
list.
`libvirt_vm_enable_efi_support`: Whether to enable EFI support. This defaults
to false as extra packages need to be installed.

Dependencies
------------
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ libvirt_host_require_vt: true

# List of architectures for which to install QEMU system emulators, e.g. x86.
libvirt_host_qemu_emulators: "{{ [] if libvirt_host_require_vt | bool else ['x86'] }}"

# Whether or not to enable UEFI support. In some cases this requires installing
# extra packages.
libvirt_host_enable_efi_support: false
13 changes: 13 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
- "{{ ansible_os_family }}.yml"
tags: vars

- name: Install custom yum repositories
# Although argument splatting is marked as deprecated:
#
# [DEPRECATION WARNING]: Using variables for task params is unsafe,
# especially if the variables come from an external source like facts. This
# feature will be removed in a future release.
#
# The core team had a a change of heart and it is actually being preserved:
# https://github.com/ansible/ansible/pull/43798
yum_repository: "{{ item }}"
loop: "{{ libvirt_host_custom_yum_repos | default([]) }}"
become: true

- name: Ensure libvirt packages are installed
package:
name: "{{ item }}"
Expand Down
12 changes: 11 additions & 1 deletion vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
---
# List of libvirt package dependencies.
libvirt_host_libvirt_packages:
libvirt_host_libvirt_packages_default:
- libvirt-bin
- qemu-kvm
- python-libvirt
- python-lxml

# Packages that are only necessary if you require EFI support
libvirt_host_packages_efi:
- ovmf

# List of all packages to install
libvirt_host_libvirt_packages: >
{{ libvirt_host_libvirt_packages_default +
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
}}
28 changes: 27 additions & 1 deletion vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
---
# List of libvirt package dependencies.
libvirt_host_libvirt_packages:
libvirt_host_libvirt_packages_default:
- libvirt
- libvirt-daemon-kvm
- libvirt-python
- python-lxml
- qemu-kvm

# Packages that are only necessary if you require EFI support
libvirt_host_packages_efi:
- edk2.git-ovmf-x64 # Official OVMF package doesn't boot (CentOS 7.5)
- qemu-kvm-ev # Need smm support for secure boot

# List of all packages to install
libvirt_host_libvirt_packages: >
{{ libvirt_host_libvirt_packages_default +
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
}}

libvirt_host_custom_yum_repos_efi:
# Add custom repository as OVMF package seems to be broken
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There have been reports that the "2015" version of OVMF may work:

https://access.redhat.com/discussions/3175901

It could also be that the OVMF shipped requires SMM.

- name: qemu-firmware-jenkins
description: upstream OVMF firmware images
baseurl: https://www.kraxel.org/repos/jenkins/
gpgcheck: no
# Need an updated version of qemu with smm support
- name: centos-qemu-ev
description: CentOS-$releasever - QEMU EV
baseurl: http://mirror.centos.org/$contentdir/$releasever/virt/$basearch/kvm-common/
gpgcheck: yes

libvirt_host_custom_yum_repos: "{{ libvirt_host_custom_yum_repos_efi if libvirt_host_enable_efi_support else [] | unique }}"