-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add usb support to libvirt-vm role (#95)
* Update Readme for USB support * Add usb_devices var to include vm.yml * adding include to validate presence of usb devices on host * adding usb section to vm.xml template * adding include to validate usb devices * moving to faile_when for cleaner handling of errors * remove loop index as Libvirt fills in data
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: List USB hardware | ||
command: lsusb -d {{ usb_device.vendor }}:{{ usb_device.product }} | ||
register: host_attached_usb_device | ||
become: true | ||
changed_when: false | ||
failed_when: false | ||
|
||
- name: Check USB device is present on Host system | ||
fail: | ||
msg: > | ||
The USB Device with Vendor ID:{{ usb_device.vendor }} and Product ID:{{ usb_device.product }} is not seen on host system | ||
Is the USB device plugged in correctly ? | ||
when: | ||
- host_attached_usb_device.rc != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters