ans2dev.general.udevadm_info module – Collect udevadm device information.
Note
This module is part of the ans2dev.general collection (version 0.2.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ans2dev.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ans2dev.general.udevadm_info
.
New in ans2dev.general 0.2.0
Synopsis
Retrieves
udevadm
information usingudevadm info
commands.Collects all properties avaible in udevadm for the selected device.
Requirements
The below requirements are needed on the host that executes this module.
udevadm info
command with-x
,--query
,--property
and--name
options.
Parameters
Parameter |
Comments |
---|---|
Device full name.
For example for |
|
This option is used if you want to collect only a specific property of the specified For example you can collect only the |
Notes
Note
Module requires
register
function in order to access to the collected info.Some device properties, like
DEVLINKS
, can have multiple values, so the module will report the values of that specific property as alist
rather than as astring
.
Examples
---
# Get full udevadm info for /dev/sda
- name: Get full udevadm info for /dev/sda
ans2dev.general.udevadm_info:
device: "/dev/sda"
register: result
# Print SCSI_VENDOR from example above
- name: Print SCSI_VENDOR of /dev/sda
ansible.builtin.debug:
var: result.udevinfo.SCSI_VENDOR
# Get only DEVPATH property from udevadm info for /dev/sda
- name: Get only DEVPATH property from udevadm info for /dev/sda
ans2dev.general.udevadm_info:
device: "/dev/sda"
property: "DEVPATH"
register: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dictionary of Additional fields will be returned depending on Returned: success |
|
The set of currently active tags on the device, indicating its runtime state. Returned: always Sample: |
|
A list of symlink paths generated by udev for stable device naming. Returned: always Sample: |
|
The device node name in /dev used for interacting with the device. Returned: always Sample: |
|
The Indicates its physical location. Returned: always Sample: |
|
Specifies the type of device. Returned: always Sample: |
|
A sequence number assigned to the disk, which can be used for ordering. Returned: always Sample: |
|
Indicates the status or state of the device under device-mapper multipath management. Returned: always Sample: |
|
Indicates the bus type used by the device. Returned: always Sample: |
|
Identifies the device model, analogous to Returned: always Sample: |
|
Encoded version of the device model, including escape sequences if necessary. Returned: always Sample: |
|
pecifies the type of partition table, such as GPT or MBR. Returned: always Sample: |
|
The universally unique identifier Returned: always Sample: |
|
Provides a unique, stable path to the device based on its physical bus location. Returned: always Sample: |
|
A sanitized version of Returned: always Sample: |
|
The revision number, firmware or hardware, of the device. Returned: always Sample: |
|
A flag confirming that the device was identified by the SCSI subsystem. Returned: always Sample: |
|
Indicates that a SCSI inquiry command was successfully executed on the device. Returned: always Sample: |
|
A unique serial number assigned to the device for identification purposes. Returned: always Sample: |
|
A shortened version of the device serial number for simpler reference. Returned: always Sample: |
|
Specifies the general type of the device. Returned: always Sample: |
|
Provides the vendor identifier for the device, similar to Returned: always Sample: |
|
Encoded vendor identifier, with escape sequences for any special characters. Returned: always Sample: |
|
The major device number identifying the kernel driver associated with the device. Returned: always Sample: |
|
The minor device number that distinguishes between devices handled by the same driver. Returned: always Sample: |
|
Specifies the path to the multipath binaries, used in environments managing multipath storage. Returned: always Sample: |
|
Combines SCSI identification details and LUN vendor information to aid in device grouping. Returned: always Sample: |
|
The model identifier of the SCSI device. Returned: always Sample: |
|
Encoded version of the SCSI model, including escape sequences where needed. Returned: always Sample: |
|
Specifies the hardware or firmware revision of the SCSI device. Returned: always Sample: |
|
Indicates SCSI Target Port Group Support. Returned: always Sample: |
|
Specifies the SCSI device type. Returned: always Sample: |
|
The vendor name of the SCSI device. Returned: always Sample: |
|
Encoded vendor name of the SCSI device, with escape sequences for special characters. Returned: always Sample: |
|
Indicates the kernel subsystem to which the device belongs. Returned: always Sample: |
|
Metadata tags applied to the device by udev, used for classification and rule matching. Returned: always Sample: |
|
A microsecond timestamp indicating when udev initialized the device. Returned: always Sample: |