Allow USB device passthrough

This commit is contained in:
Timo Makinen 2022-04-13 20:49:51 +00:00
parent 1081b98b09
commit 9f31fcfd52

View file

@ -34,13 +34,6 @@
{% endif %}
{% endfor %}
virt_install_passthrough: >-
{% if passthrough_devices is defined %}
{% for item in passthrough_devices %}
--hostdev {{ item }}
{% endfor %}
{% endif %}
tasks:
- name: get vm list
@ -86,8 +79,7 @@
command: >
virt-install --name {{ inventory_hostname }} \
--graphics none --boot useserial=on --noautoconsole \
--serial pty,log.file={{ console_log }} \
--controller usb,model=none --sound none \
--serial pty,log.file={{ console_log }} --sound none \
--vcpus "sockets=1,cores={{ num_cpus }},threads=1,placement=auto" \
--memory {{ mem_size }} --cpu host-passthrough \
--disk {{ os_disk_image }},{{ dsk_opts }},size={{ dsk_size }} \
@ -101,9 +93,10 @@
{% for dev in virt_install_devices -%}
--hostdev {{ dev }} \
{% endfor -%}
{% else -%}
--controller usb,model=none \
{% endif -%}
{{ virt_install_disks }} \
{{ virt_install_passthrough }} \
{{ virt_install_network }} \
{{ virt_install_os_args }}
delegate_to: "{{ vmhost }}"