File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ allocated.
50
50
Each network interface is defined with the following dict:
51
51
- ` network ` : Name of the network to which an interface should be attached.
52
52
53
+ ` libvirt_vm_console_log_path ` : Path to console log file. Default is
54
+ ` /var/log/libvirt/qemu/{{ libvirt_vm_name }}-console.log ` .
55
+
53
56
` libvirt_vm_image_cache_path ` : path to cache downloaded images.
54
57
55
58
Dependencies
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ libvirt_vm_volumes: []
34
34
# List of network interfaces.
35
35
libvirt_vm_interfaces : []
36
36
37
+ # Path to console log file.
38
+ libvirt_vm_console_log_path : " /var/log/libvirt-consoles/{{ libvirt_vm_name }}.log"
39
+
37
40
# Path to cache downloaded images.
38
41
libvirt_vm_image_cache_path :
39
42
Original file line number Diff line number Diff line change 1
1
---
2
+ - name : Ensure the VM console log directory exists
3
+ file :
4
+ path : " {{ libvirt_vm_console_log_path | dirname }}"
5
+ state : directory
6
+ owner : qemu
7
+ group : qemu
8
+ recurse : true
9
+ mode : 0770
10
+ become : true
11
+
2
12
- name : Ensure the VM is defined
3
13
virt :
4
14
name : " {{ libvirt_vm_name }}"
Original file line number Diff line number Diff line change 26
26
<model type =' virtio' />
27
27
</interface >
28
28
{% endfor %}
29
- <serial type =' pty ' >
30
- <target port = ' 0 ' />
29
+ <serial type =' file ' >
30
+ <source path = ' {{ libvirt_vm_console_log_path }} ' />
31
31
</serial >
32
- <console type =' pty' >
33
- <target type =' serial' port =' 0' />
32
+ <serial type =' pty' />
33
+ <console type =' file' >
34
+ <source path =' {{ libvirt_vm_console_log_path }}' />
35
+ <target type =' serial' />
34
36
</console >
35
37
</devices >
36
38
</domain >
You can’t perform that action at this time.
0 commit comments