Skip to content

Commit 182e154

Browse files
authored
Merge pull request #64 from roumano/spice
Spice
2 parents 72a7fb6 + 6b7046c commit 182e154

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ Role Variables
9090
- `enable_vnc`: If true enables VNC listening on localhost for use with
9191
VirtManager and similar tools
9292

93+
- `enable_spice`: If true enables SPICE listening for use with
94+
Virtual Machine Manager and similar tools
95+
9396
- `volumes`: a list of volumes to attach to the VM. Each volume is
9497
defined with the following dict:
9598
- `type`: What type of backing volume does the instance use? All

tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
start: "{{ vm.start | default(true) }}"
3838
autostart: "{{ vm.autostart | default(true) }}"
3939
enable_vnc: "{{ vm.enable_vnc | default(false) }}"
40+
enable_spice: "{{ vm.enable_spice | default(false) }}"
4041
with_items: "{{ libvirt_vms }}"
4142
loop_control:
4243
loop_var: vm
@@ -54,4 +55,4 @@
5455
with_items: "{{ libvirt_vms }}"
5556
loop_control:
5657
loop_var: vm
57-
when: (vm.state | default('present', true)) == 'absent'
58+
when: (vm.state | default('present', true)) == 'absent'

templates/vm.xml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@
103103
<graphics type='vnc' autoport='yes' listen='127.0.0.1'>
104104
<listen type='address' address='127.0.0.1'/>
105105
</graphics>
106+
{% endif %}
107+
{% if enable_spice |bool %}
108+
<graphics type='spice' autoport='yes'>
109+
<listen type='address'/>
110+
</graphics>
106111
{% endif %}
107112
<rng model="virtio"><backend model="random">/dev/urandom</backend></rng>
108113
</devices>

0 commit comments

Comments
 (0)