community / community.general / 8.5.0 / module / usb_facts Allows listing information about USB devices | "added in version" 8.5.0 of community.general" Authors: Max Maxopoly (@maxopoly)community.general.usb_facts (8.5.0) — module
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
Allows retrieving information about available USB devices through C(lsusb).
- name: Get information about USB devices community.general.usb_facts:
- name: Print information about USB devices ansible.builtin.debug: msg: "On bus {{ item.bus }} device {{ item.device }} with id {{ item.id }} is {{ item.name }}" loop: "{{ ansible_facts.usb_devices }}"
ansible_facts: contains: usb_devices: contains: bus: description: The bus the usb device is connected to. returned: always sample: '001' type: str device: description: The device number occupied on the bus. returned: always sample: '002' type: str id: description: ID of the USB device. returned: always sample: 1d6b:0002 type: str name: description: Human readable name of the device. returned: always sample: Linux Foundation 2.0 root hub type: str description: A list of USB devices available. elements: dict returned: always type: list description: Dictionary containing details of connected USB devices. returned: always type: dict