File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ Technology (VT) is enabled in order to run this role. While this provides
6262better VM performance, it may not be available in certain environments. The
6363default value is ` true ` .
6464
65+ ` libvirt_host_arch ` : Architecture of the libvirt host. This defaults to
66+ ` ansible_facts.architecture ` .
67+
6568` libvirt_host_qemu_emulators ` : List of architectures for which to install QEMU
6669system emulators, e.g. ` x86 ` . The default value is ` ['x86'] ` if
6770
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ libvirt_host_networks: []
2525# be available in certain environments.
2626libvirt_host_require_vt : true
2727
28+ # Architecture of the libvirt host.
29+ libvirt_host_arch : " {{ ansible_facts.architecture }}"
30+
2831# List of architectures for which to install QEMU system emulators, e.g. x86.
2932libvirt_host_qemu_emulators : " {{ [] if libvirt_host_require_vt | bool else ['x86'] }}"
3033
Original file line number Diff line number Diff line change 11---
2- - name : Verify that Virtualization Technology (VT) is enabled
2+ - name : Verify that Virtualization Technology (VT) is enabled on x86_64
33 command : grep -c -E 'svm|vmx' /proc/cpuinfo
44 check_mode : False
55 changed_when : False
66 failed_when : False
7- register : result
7+ register : x86_vt_result
8+ when : libvirt_host_arch == 'x86_64'
9+
10+ - name : Verify that KVM is available on non-x86_64
11+ stat :
12+ path : /dev/kvm
13+ register : kvm_device
14+ when : libvirt_host_arch != 'x86_64'
815
916- name : Set a fact about whether Virtualization Technology (VT) is enabled
1017 set_fact :
11- libvirt_host_vt_enabled : " {{ result.rc == 0 }}"
18+ libvirt_host_vt_enabled : >-
19+ {{
20+ (x86_vt_result.rc == 0)
21+ if libvirt_host_arch == 'x86_64'
22+ else kvm_device.stat.exists
23+ }}
1224
1325 - name : Notify if Virtualization Technology (VT) is disabled
1426 debug :
Original file line number Diff line number Diff line change 11---
22# List of package dependencies common to all Debian distributions
33libvirt_host_libvirt_packages_common :
4- - qemu-system-x86
4+ - " {{ ' qemu-system-arm' if libvirt_host_arch == 'aarch64' else 'qemu-system- x86' }} "
55
66# List of all daemon packages to install.
77libvirt_host_libvirt_packages_libvirt_daemon :
@@ -28,7 +28,7 @@ libvirt_host_libvirt_packages_client_default:
2828
2929# Packages that are only necessary if you require EFI support
3030libvirt_host_packages_efi :
31- - ovmf
31+ - " {{ 'qemu-efi-aarch64' if libvirt_host_arch == 'aarch64' else ' ovmf' }} "
3232
3333# Packages for RBD volume pool support
3434libvirt_host_packages_rbd_volume_pool :
Original file line number Diff line number Diff line change @@ -28,8 +28,11 @@ libvirt_host_packages_efi_by_version:
2828 10 :
2929 - edk2-ovmf
3030
31+ libvirt_host_packages_efi_aarch64 : >-
32+ {{ [] if ansible_facts.distribution_major_version | int == 7 else ['edk2-aarch64'] }}
33+
3134libvirt_host_packages_efi : >-
32- {{ libvirt_host_packages_efi_by_version[ansible_facts.distribution_major_version | int] }}
35+ {{ libvirt_host_packages_efi_aarch64 if libvirt_host_arch == 'aarch64' else libvirt_host_packages_efi_by_version[ansible_facts.distribution_major_version | int] }}
3336
3437# Packages for RBD volume pool support
3538libvirt_host_packages_rbd_volume_pool :
@@ -61,7 +64,10 @@ libvirt_host_custom_yum_repos_efi_by_version:
6164 10 : []
6265
6366libvirt_host_custom_yum_repos : >-
64- {{ libvirt_host_custom_yum_repos_efi_by_version[ansible_facts.distribution_major_version | int] }}
67+ {{
68+ [] if libvirt_host_arch == 'aarch64'
69+ else libvirt_host_custom_yum_repos_efi_by_version[ansible_facts.distribution_major_version | int]
70+ }}
6571
6672# These are passed to the lineinfile module to customize configuration files
6773libvirt_host_lineinfile_extra_rules :
You can’t perform that action at this time.
0 commit comments