File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ Technology (VT) is enabled in order to run this role. While this provides
34
34
better VM performance, it may not be available in certain environments. The
35
35
default value is ` true ` .
36
36
37
+ ` libvirt_host_qemu_emulators ` : List of architectures for which to install QEMU
38
+ system emulators, e.g. ` x86 ` . The default value is ` ['x86'] ` if
39
+ ` libvirt_host_require_vt ` is ` false ` , otherwise the default value is an empty
40
+ list.
41
+
37
42
Dependencies
38
43
------------
39
44
Original file line number Diff line number Diff line change @@ -22,3 +22,6 @@ libvirt_host_networks: []
22
22
# order to run this role. While this provides better VM performance, it may not
23
23
# be available in certain environments.
24
24
libvirt_host_require_vt : true
25
+
26
+ # List of architectures for which to install QEMU system emulators, e.g. x86.
27
+ libvirt_host_qemu_emulators : " {{ [] if libvirt_host_require_vt | bool else ['x86'] }}"
Original file line number Diff line number Diff line change 11
11
- qemu-kvm
12
12
become : True
13
13
14
+ # NOTE: QEMU emulators are available in EPEL.
15
+ - name : Ensure the EPEL repository is enabled
16
+ yum :
17
+ name : epel-release
18
+ state : installed
19
+ when : libvirt_host_qemu_emulators | length > 0
20
+ become : True
21
+
22
+ - name : Ensure QEMU emulator packages are installed
23
+ yum :
24
+ name : " {{ package }}"
25
+ state : installed
26
+ with_items : " {{ libvirt_host_qemu_emulators }}"
27
+ become : True
28
+ vars :
29
+ package : " qemu-system-{{ item }}"
30
+
14
31
- name : Ensure the libvirt daemon is started and enabled
15
32
service :
16
33
name : libvirtd
Original file line number Diff line number Diff line change 5
5
failed_when : False
6
6
register : result
7
7
8
+ - name : Set a fact about whether Virtualization Technology (VT) is enabled
9
+ set_fact :
10
+ libvirt_host_vt_enabled : " {{ result.rc == 0 }}"
11
+
8
12
- name : Notify if Virtualization Technology (VT) is disabled
9
13
debug :
10
14
msg : >
11
15
Virtualization Technology (VT) is currently disabled. Please enable VT
12
16
before running this role again.
13
17
when :
14
18
- not libvirt_host_require_vt | bool
15
- - result.rc != 0
19
+ - not libvirt_host_vt_enabled
16
20
17
21
- name : Fail if Virtualization Technology (VT) is disabled
18
22
fail :
21
25
before running this role again.
22
26
when :
23
27
- libvirt_host_require_vt | bool
24
- - result.rc != 0
28
+ - not libvirt_host_vt_enabled
You can’t perform that action at this time.
0 commit comments