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
8686 - ` console_log_path ` : Path to console log file. Default is
8787 ` {{ libvirt_vm_default_console_log_dir }}/{{ name }}-console.log ` .
8888
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+
8995
9096N.B. the following variables are deprecated: ` libvirt_vm_state ` ,
9197` libvirt_vm_name ` , ` libvirt_vm_memory_mb ` , ` libvirt_vm_vcpus ` ,
Original file line number Diff line number Diff line change 2424 cpu_mode : " {{ vm.cpu_mode | default(cpu_mode_default, true) }}"
2525 volumes : " {{ vm.volumes | default([], true) }}"
2626 interfaces : " {{ vm.interfaces | default([], true) }}"
27+ start : " {{ vm.start | default(true) }}"
28+ autostart : " {{ vm.autostart | default(true) }}"
2729 with_items : " {{ libvirt_vms }}"
2830 loop_control :
2931 loop_var : vm
Original file line number Diff line number Diff line change 1414 include_tasks : check-interface.yml
1515 vars :
1616 interface : " {{ item }}"
17- with_items : " {{ vm. interfaces }}"
17+ with_items : " {{ interfaces }}"
1818
1919- name : Ensure the VM is defined
2020 virt :
2626- name : Ensure the VM is running and started at boot
2727 virt :
2828 name : " {{ vm.name }}"
29- autostart : true
30- state : running
29+ autostart : " {{ autostart | bool }} "
30+ state : " {{ ' running' if (start | bool) else 'shutdown' }} "
3131 become : true
You can’t perform that action at this time.
0 commit comments