File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ Role Variables
86
86
- ` console_log_path ` : Path to console log file. Default is
87
87
` {{ libvirt_vm_default_console_log_dir }}/{{ name }}-console.log ` .
88
88
89
+ - ` start ` : Whether to immediately start the VM after defining it. Default
90
+ is ` true ` .
91
+
92
+ - ` autostart ` : Whether to start the VM when the host starts up. Default is
93
+ ` true ` .
94
+
89
95
90
96
N.B. the following variables are deprecated: ` libvirt_vm_state ` ,
91
97
` libvirt_vm_name ` , ` libvirt_vm_memory_mb ` , ` libvirt_vm_vcpus ` ,
Original file line number Diff line number Diff line change 24
24
cpu_mode : " {{ vm.cpu_mode | default(cpu_mode_default, true) }}"
25
25
volumes : " {{ vm.volumes | default([], true) }}"
26
26
interfaces : " {{ vm.interfaces | default([], true) }}"
27
+ start : " {{ vm.start | default(true) }}"
28
+ autostart : " {{ vm.autostart | default(true) }}"
27
29
with_items : " {{ libvirt_vms }}"
28
30
loop_control :
29
31
loop_var : vm
Original file line number Diff line number Diff line change 14
14
include_tasks : check-interface.yml
15
15
vars :
16
16
interface : " {{ item }}"
17
- with_items : " {{ vm. interfaces }}"
17
+ with_items : " {{ interfaces }}"
18
18
19
19
- name : Ensure the VM is defined
20
20
virt :
26
26
- name : Ensure the VM is running and started at boot
27
27
virt :
28
28
name : " {{ vm.name }}"
29
- autostart : true
30
- state : running
29
+ autostart : " {{ autostart | bool }} "
30
+ state : " {{ ' running' if (start | bool) else 'shutdown' }} "
31
31
become : true
You can’t perform that action at this time.
0 commit comments