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.
5050Each network interface is defined with the following dict:
5151- ` network ` : Name of the network to which an interface should be attached.
5252
53+ ` libvirt_vm_console_log_path ` : Path to console log file. Default is
54+ ` /var/log/libvirt/qemu/{{ libvirt_vm_name }}-console.log ` .
55+
5356` libvirt_vm_image_cache_path ` : path to cache downloaded images.
5457
5558Dependencies
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ libvirt_vm_volumes: []
3434# List of network interfaces.
3535libvirt_vm_interfaces : []
3636
37+ # Path to console log file.
38+ libvirt_vm_console_log_path : " /var/log/libvirt-consoles/{{ libvirt_vm_name }}.log"
39+
3740# Path to cache downloaded images.
3841libvirt_vm_image_cache_path :
3942
Original file line number Diff line number Diff line change 11---
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+
212- name : Ensure the VM is defined
313 virt :
414 name : " {{ libvirt_vm_name }}"
Original file line number Diff line number Diff line change 2626 <model type =' virtio' />
2727 </interface >
2828{% endfor %}
29- <serial type =' pty ' >
30- <target port = ' 0 ' />
29+ <serial type =' file ' >
30+ <source path = ' {{ libvirt_vm_console_log_path }} ' />
3131 </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' />
3436 </console >
3537 </devices >
3638</domain >
You can’t perform that action at this time.
0 commit comments