File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 4
4
when : " libvirt_vms | rejectattr('state', 'eq', 'absent')"
5
5
6
6
- include_tasks : volumes.yml
7
+ vars :
8
+ libvirt_vm_volumes : " {{ vm.volumes | default([]) }}"
7
9
with_items : " {{ libvirt_vms }}"
8
10
loop_control :
9
11
loop_var : vm
10
12
when : (vm.state | default('present')) == 'present'
11
13
12
14
- include_tasks : vm.yml
15
+ vars :
16
+ libvirt_vm_console_log_path : " {{ vm.console_log_path | default(libvirt_vm_default_console_log_dir + '/' + vm.name + 'console.log') }}"
17
+ libvirt_vm_name : " {{ vm.name }}"
18
+ machine_default : " {{ none if libvirt_vm_engine == 'kvm' else 'pc-1.0' }}"
19
+ libvirt_vm_machine : " {{ vm.machine | default(machine_default) }}"
20
+ cpu_mode_default : " {{ 'host-passthrough' if libvirt_vm_engine == 'kvm' else 'host-model' }}"
21
+ libvirt_vm_cpu_mode : " {{ vm.cpu_mode | default(cpu_mode_default) }}"
22
+ libvirt_vm_volumes : " {{ vm.volumes | default([]) }}"
23
+ libvirt_vm_interfaces : " {{ vm.interfaces | default([]) }}"
13
24
with_items : " {{ libvirt_vms }}"
14
25
loop_control :
15
26
loop_var : vm
16
27
when : (vm.state | default('present')) == 'present'
17
28
18
29
- include_tasks : destroy-volumes.yml
30
+ vars :
31
+ libvirt_vm_volumes : " {{ vm.volumes | default([]) }}"
19
32
with_items : " {{ libvirt_vms }}"
20
33
loop_control :
21
34
loop_var : vm
22
35
when : (vm.state | default('present')) == 'absent'
23
36
24
37
- include_tasks : destroy-vm.yml
38
+ vars :
39
+ libvirt_vm_name : " {{ vm.name }}"
25
40
with_items : " {{ libvirt_vms }}"
26
41
loop_control :
27
42
loop_var : vm
You can’t perform that action at this time.
0 commit comments