| 1 |
.. _ome_device_info_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_device_info -- Retrieves the information of devices inventoried by OpenManage Enterprise |
| 5 |
============================================================================================ |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module retrieves the list of devices in the inventory of OpenManage Enterprise along with the details of each device. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- python \>= 3.9.6 |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
Parameters |
| 28 |
---------- |
| 29 |
|
| 30 |
fact_subset (optional, str, basic_inventory) |
| 31 |
\ :literal:`basic\_inventory`\ returns the list of the devices. |
| 32 |
|
| 33 |
\ :literal:`detailed\_inventory`\ returns the inventory details of specified devices. |
| 34 |
|
| 35 |
\ :literal:`subsystem\_health`\ returns the health status of specified devices. |
| 36 |
|
| 37 |
|
| 38 |
system_query_options (optional, dict, None) |
| 39 |
\ :emphasis:`system\_query\_options`\ applicable for the choices of the fact\_subset. Either \ :emphasis:`device\_id`\ or \ :emphasis:`device\_service\_tag`\ is mandatory for \ :literal:`detailed\_inventory`\ and \ :literal:`subsystem\_health`\ or both can be applicable. |
| 40 |
|
| 41 |
|
| 42 |
device_id (optional, list, None) |
| 43 |
A list of unique identifier is applicable for \ :literal:`detailed\_inventory`\ and \ :literal:`subsystem\_health`\ . |
| 44 |
|
| 45 |
|
| 46 |
device_service_tag (optional, list, None) |
| 47 |
A list of service tags are applicable for \ :literal:`detailed\_inventory`\ and \ :literal:`subsystem\_health`\ . |
| 48 |
|
| 49 |
|
| 50 |
inventory_type (optional, str, None) |
| 51 |
For \ :literal:`detailed\_inventory`\ , it returns details of the specified inventory type. |
| 52 |
|
| 53 |
|
| 54 |
filter (optional, str, None) |
| 55 |
For \ :literal:`basic\_inventory`\ , it filters the collection of devices. \ :emphasis:`filter`\ query format should be aligned with OData standards. |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
hostname (True, str, None) |
| 60 |
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
| 61 |
|
| 62 |
|
| 63 |
username (False, str, None) |
| 64 |
OpenManage Enterprise or OpenManage Enterprise Modular username. |
| 65 |
|
| 66 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 67 |
|
| 68 |
Example: export OME\_USERNAME=username |
| 69 |
|
| 70 |
|
| 71 |
password (False, str, None) |
| 72 |
OpenManage Enterprise or OpenManage Enterprise Modular password. |
| 73 |
|
| 74 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 75 |
|
| 76 |
Example: export OME\_PASSWORD=password |
| 77 |
|
| 78 |
|
| 79 |
x_auth_token (False, str, None) |
| 80 |
Authentication token. |
| 81 |
|
| 82 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 83 |
|
| 84 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 85 |
|
| 86 |
|
| 87 |
port (optional, int, 443) |
| 88 |
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. |
| 89 |
|
| 90 |
|
| 91 |
validate_certs (optional, bool, True) |
| 92 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 93 |
|
| 94 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 95 |
|
| 96 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 97 |
|
| 98 |
|
| 99 |
ca_path (optional, path, None) |
| 100 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 101 |
|
| 102 |
|
| 103 |
timeout (optional, int, 30) |
| 104 |
The socket level timeout in seconds. |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
Notes |
| 111 |
----- |
| 112 |
|
| 113 |
.. note:: |
| 114 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 115 |
- This module supports \ :literal:`check\_mode`\ . |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
Examples |
| 121 |
-------- |
| 122 |
|
| 123 |
.. code-block:: yaml+jinja |
| 124 |
|
| 125 |
|
| 126 |
--- |
| 127 |
- name: Retrieve basic inventory of all devices |
| 128 |
dellemc.openmanage.ome_device_info: |
| 129 |
hostname: "192.168.0.1" |
| 130 |
username: "username" |
| 131 |
password: "password" |
| 132 |
ca_path: "/path/to/ca_cert.pem" |
| 133 |
|
| 134 |
- name: Retrieve basic inventory for devices identified by IDs 33333 or 11111 using filtering |
| 135 |
dellemc.openmanage.ome_device_info: |
| 136 |
hostname: "192.168.0.1" |
| 137 |
username: "username" |
| 138 |
password: "password" |
| 139 |
ca_path: "/path/to/ca_cert.pem" |
| 140 |
fact_subset: "basic_inventory" |
| 141 |
system_query_options: |
| 142 |
filter: "Id eq 33333 or Id eq 11111" |
| 143 |
|
| 144 |
- name: Retrieve inventory details of specified devices identified by IDs 11111 and 22222 |
| 145 |
dellemc.openmanage.ome_device_info: |
| 146 |
hostname: "192.168.0.1" |
| 147 |
username: "username" |
| 148 |
password: "password" |
| 149 |
ca_path: "/path/to/ca_cert.pem" |
| 150 |
fact_subset: "detailed_inventory" |
| 151 |
system_query_options: |
| 152 |
device_id: |
| 153 |
- 11111 |
| 154 |
- 22222 |
| 155 |
|
| 156 |
- name: Retrieve inventory details of specified devices identified by service tags MXL1234 and MXL4567 |
| 157 |
dellemc.openmanage.ome_device_info: |
| 158 |
hostname: "192.168.0.1" |
| 159 |
username: "username" |
| 160 |
password: "password" |
| 161 |
ca_path: "/path/to/ca_cert.pem" |
| 162 |
fact_subset: "detailed_inventory" |
| 163 |
system_query_options: |
| 164 |
device_service_tag: |
| 165 |
- MXL1234 |
| 166 |
- MXL4567 |
| 167 |
|
| 168 |
- name: Retrieve details of specified inventory type of specified devices identified by ID and service tags |
| 169 |
dellemc.openmanage.ome_device_info: |
| 170 |
hostname: "192.168.0.1" |
| 171 |
username: "username" |
| 172 |
password: "password" |
| 173 |
ca_path: "/path/to/ca_cert.pem" |
| 174 |
fact_subset: "detailed_inventory" |
| 175 |
system_query_options: |
| 176 |
device_id: |
| 177 |
- 11111 |
| 178 |
device_service_tag: |
| 179 |
- MXL1234 |
| 180 |
- MXL4567 |
| 181 |
inventory_type: "serverDeviceCards" |
| 182 |
|
| 183 |
- name: Retrieve subsystem health of specified devices identified by service tags |
| 184 |
dellemc.openmanage.ome_device_info: |
| 185 |
hostname: "192.168.0.1" |
| 186 |
username: "username" |
| 187 |
password: "password" |
| 188 |
ca_path: "/path/to/ca_cert.pem" |
| 189 |
fact_subset: "subsystem_health" |
| 190 |
system_query_options: |
| 191 |
device_service_tag: |
| 192 |
- MXL1234 |
| 193 |
- MXL4567 |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
Return Values |
| 198 |
------------- |
| 199 |
|
| 200 |
msg (on error, str, Failed to fetch the device information) |
| 201 |
Over all device information status. |
| 202 |
|
| 203 |
|
| 204 |
device_info (success, dict, {'value': [{'Actions': None, 'AssetTag': None, 'ChassisServiceTag': None, 'ConnectionState': True, 'DeviceManagement': [{'DnsName': 'dnsname.host.com', 'InstrumentationName': 'MX-12345', 'MacAddress': '11:10:11:10:11:10', 'ManagementId': 12345, 'ManagementProfile': [{'HasCreds': 0, 'ManagementId': 12345, 'ManagementProfileId': 12345, 'ManagementURL': 'https://192.168.0.1:443', 'Status': 1000, 'StatusDateTime': '2019-01-21 06:30:08.501'}], 'ManagementType': 2, 'NetworkAddress': '192.168.0.1'}], 'DeviceName': 'MX-0003I', 'DeviceServiceTag': 'MXL1234', 'DeviceSubscription': None, 'LastInventoryTime': '2019-01-21 06:30:08.501', 'LastStatusTime': '2019-01-21 06:30:02.492', 'ManagedState': 3000, 'Model': 'PowerEdge MX7000', 'PowerState': 17, 'SlotConfiguration': {}, 'Status': 4000, 'SystemId': 2031, 'Type': 2000}]}) |
| 205 |
Returns the information collected from the Device. |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
Status |
| 212 |
------ |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
Authors |
| 219 |
~~~~~~~ |
| 220 |
|
| 221 |
- Sajna Shetty (@Sajna-Shetty) |
| 222 |
- Felix Stephen (@felixs88) |
| 223 |
- Sapana Gupta (@sapana05) |
| 224 |
|