shaker/sys-usb/create.sls

73 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2019-08-14 11:10:16 -04:00
include:
- sys-usb.clone
remove:
qvm.absent:
2019-08-15 11:23:25 -04:00
- names:
- sys-usb
- sys-usb-dock
- sys-usb-left
- sys-usb-dvm
2019-08-14 11:10:16 -04:00
2019-08-15 11:23:25 -04:00
sys-usb-dvm:
2019-08-14 11:10:16 -04:00
qvm.present:
- name: sys-usb-dvm
- template: template-sys-usb
- label: red
qvm-prefs-id:
qvm.prefs:
- name: sys-usb-dvm
- netvm: none
- memory: 300
- vcpus: 2
- virt_mode: hvm
- autostart: False
- template_for_dispvms: True
- include_in_backups: false
2019-08-15 11:23:25 -04:00
{% set usbs = ['sys-usb','sys-usb-dock','sys-usb-left'] %}
{% for usb in usbs %}
{{usb}}:
2019-08-14 11:10:16 -04:00
qvm.present:
2019-08-15 11:23:25 -04:00
- name:
- {{usb}}
2019-08-14 11:10:16 -04:00
- template: sys-usb-dvm
- class: DispVM
- label: red
2019-08-15 11:23:25 -04:00
{{usb}}-prefs:
2019-08-14 11:10:16 -04:00
qvm.prefs:
2019-08-15 11:23:25 -04:00
- name: {{usb}}
2019-08-14 11:10:16 -04:00
- autostart: false
- include_in_backups: false
- pci_strictreset: False
2019-08-15 11:23:25 -04:00
{% if usb == 'sys-usb' %}
- pcidevs: [ '00:1a.0' ]
{% elif usb == 'sys-usb-left' %}
- pcidevs: [ '00:14.0' ]
2019-08-15 11:23:25 -04:00
{% elif usb == 'sys-usb-dock' %}
- pcidevs: [ '00:1d.0' ]
{% endif %}
2019-08-15 11:23:25 -04:00
{{usb}}-features:
qvm.features:
2019-08-15 11:23:25 -04:00
- name: {{usb}}
- disable:
- service.cups
- service.cups-browsed
- service.meminfo-writer
- service.cups-browsed
- service.qubes-updates-proxy
2019-08-15 11:23:25 -04:00
{% endfor%}
2019-08-14 11:10:16 -04:00
update_file:
file.prepend:
2019-08-15 11:23:25 -04:00
- names:
- /etc/qubes-rpc/policy/qubes.InputMouse
- /etc/qubes-rpc/policy/qubes.InputKeyboard
2019-08-14 11:10:16 -04:00
- text: sys-usb dom0 allow,user=root
- text: sys-usb-dock dom0 allow,user=root
2019-08-14 11:10:16 -04:00