File tree Expand file tree Collapse file tree 4 files changed +51
-1
lines changed Expand file tree Collapse file tree 4 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ should be a dict containing the following items:
30
30
supported.
31
31
- ` bridge ` The name of the bridge interface for this network.
32
32
33
+ ` libvirt_host_require_vt ` is whether to require that Intel Virtualisation
34
+ Technology (VT) is enabled in order to run this role. While this provides
35
+ better VM performance, it may not be available in certain environments. The
36
+ default value is ` true ` .
37
+
38
+ ` libvirt_host_qemu_emulators ` : List of architectures for which to install QEMU
39
+ system emulators, e.g. ` x86 ` . The default value is ` ['x86'] ` if
40
+ ` libvirt_host_require_vt ` is ` false ` , otherwise the default value is an empty
41
+ list.
42
+
33
43
Dependencies
34
44
------------
35
45
Original file line number Diff line number Diff line change @@ -17,3 +17,11 @@ libvirt_host_pools: []
17
17
# supported.
18
18
# bridge: The name of the bridge interface for this network.
19
19
libvirt_host_networks : []
20
+
21
+ # Whether to require that Intel Virtualisation Technology (VT) is enabled in
22
+ # order to run this role. While this provides better VM performance, it may not
23
+ # be available in certain environments.
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
+
12
+ - name : Notify if Virtualization Technology (VT) is disabled
13
+ debug :
14
+ msg : >
15
+ Virtualization Technology (VT) is currently disabled. Please enable VT
16
+ before running this role again.
17
+ when :
18
+ - not libvirt_host_require_vt | bool
19
+ - not libvirt_host_vt_enabled
20
+
8
21
- name : Fail if Virtualization Technology (VT) is disabled
9
22
fail :
10
23
msg : >
11
24
Virtualization Technology (VT) is currently disabled. Please enable VT
12
25
before running this role again.
13
- when : result.rc != 0
26
+ when :
27
+ - libvirt_host_require_vt | bool
28
+ - not libvirt_host_vt_enabled
You can’t perform that action at this time.
0 commit comments