File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,10 @@ libvirt_vm_virsh_default_env: "{{ { 'LIBVIRT_DEFAULT_URI': libvirt_vm_uri } if
92
92
# Override for the libvirt connection uri. Leave unset to use the default.
93
93
libvirt_vm_uri : " "
94
94
95
+ # Whether to use sudo with libvirt commands, this can be disabled with qemu:///session
96
+ # to create VMs as an unprivileged user
97
+ libvirt_vm_sudo : true
98
+
95
99
# Default CPU mode if libvirt_vm_cpu_mode or vm.cpu_mode is undefined
96
100
libvirt_cpu_mode_default : " {{ 'host-passthrough' if libvirt_vm_engine == 'kvm' else 'host-model' }}"
97
101
Original file line number Diff line number Diff line change 8
8
recurse : true
9
9
mode : 0770
10
10
when : console_log_enabled | bool
11
- become : true
11
+ become : " {{ libvirt_vm_sudo }} "
12
12
13
13
- name : Validate VM interfaces
14
14
include_tasks : check-interface.yml
22
22
command : define
23
23
xml : " {{ lookup('template', vm.xml_file | default('vm.xml.j2')) }}"
24
24
uri : " {{ libvirt_vm_uri | default(omit, true) }}"
25
- become : true
25
+ become : " {{ libvirt_vm_sudo }} "
26
26
27
27
- name : Ensure the VM is running and started at boot
28
28
virt :
29
29
name : " {{ vm.name }}"
30
30
autostart : " {{ autostart | bool }}"
31
31
state : " {{ 'running' if (start | bool) else 'shutdown' }}"
32
32
uri : " {{ libvirt_vm_uri | default(omit, true) }}"
33
- become : true
33
+ become : " {{ libvirt_vm_sudo }} "
You can’t perform that action at this time.
0 commit comments