| 1 |
.. _ome_devices_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_devices -- Perform device-specific operations on target devices |
| 5 |
=================================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
Perform device-specific operations such as refresh inventory, clear iDRAC job queue, and reset iDRAC from OpenManage Enterprise. |
| 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 |
device_service_tags (optional, list, None) |
| 31 |
Service tag of the target devices. |
| 32 |
|
| 33 |
This is mutually exclusive with \ :emphasis:`device\_ids`\ . |
| 34 |
|
| 35 |
|
| 36 |
device_ids (optional, list, None) |
| 37 |
IDs of the target devices. |
| 38 |
|
| 39 |
This is mutually exclusive with \ :emphasis:`device\_service\_tags`\ . |
| 40 |
|
| 41 |
|
| 42 |
state (optional, str, present) |
| 43 |
\ :literal:`present`\ Allows to perform the \ :emphasis:`device\_action`\ on the target devices. |
| 44 |
|
| 45 |
\ :literal:`absent`\ Removes the device from OpenManage Enterprise. Job is not triggered. \ :emphasis:`job\_wait`\ , \ :emphasis:`job\_schedule`\ , \ :emphasis:`job\_name`\ , and \ :emphasis:`job\_description`\ are not applicable to this operation. |
| 46 |
|
| 47 |
|
| 48 |
device_action (optional, str, refresh_inventory) |
| 49 |
\ :literal:`refresh\_inventory`\ refreshes the inventory on the target devices. |
| 50 |
|
| 51 |
\ :literal:`reset\_idrac`\ Triggers a reset on the target iDRACs. |
| 52 |
|
| 53 |
\ :literal:`clear\_idrac\_job\_queue`\ Clears the job queue on the target iDRACs. |
| 54 |
|
| 55 |
A job is triggered for each action. |
| 56 |
|
| 57 |
|
| 58 |
job_wait (optional, bool, True) |
| 59 |
Provides an option to wait for the job completion. |
| 60 |
|
| 61 |
This option is applicable when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 62 |
|
| 63 |
This is applicable when \ :emphasis:`job\_schedule`\ is \ :literal:`startnow`\ . |
| 64 |
|
| 65 |
|
| 66 |
job_wait_timeout (optional, int, 1200) |
| 67 |
The maximum wait time of \ :emphasis:`job\_wait`\ in seconds. The job is tracked only for this duration. |
| 68 |
|
| 69 |
This option is applicable when \ :emphasis:`job\_wait`\ is \ :literal:`true`\ . |
| 70 |
|
| 71 |
|
| 72 |
job_schedule (optional, str, startnow) |
| 73 |
Provide the cron string to schedule the job. |
| 74 |
|
| 75 |
|
| 76 |
job_name (optional, str, None) |
| 77 |
Optional name for the job. |
| 78 |
|
| 79 |
|
| 80 |
job_description (optional, str, None) |
| 81 |
Optional description for the job. |
| 82 |
|
| 83 |
|
| 84 |
hostname (True, str, None) |
| 85 |
OpenManage Enterprise IP address or hostname. |
| 86 |
|
| 87 |
|
| 88 |
username (False, str, None) |
| 89 |
OpenManage Enterprise username. |
| 90 |
|
| 91 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 92 |
|
| 93 |
Example: export OME\_USERNAME=username |
| 94 |
|
| 95 |
|
| 96 |
password (False, str, None) |
| 97 |
OpenManage Enterprise password. |
| 98 |
|
| 99 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 100 |
|
| 101 |
Example: export OME\_PASSWORD=password |
| 102 |
|
| 103 |
|
| 104 |
x_auth_token (False, str, None) |
| 105 |
Authentication token. |
| 106 |
|
| 107 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 108 |
|
| 109 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 110 |
|
| 111 |
|
| 112 |
port (optional, int, 443) |
| 113 |
OpenManage Enterprise HTTPS port. |
| 114 |
|
| 115 |
|
| 116 |
validate_certs (optional, bool, True) |
| 117 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 118 |
|
| 119 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 120 |
|
| 121 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 122 |
|
| 123 |
|
| 124 |
ca_path (optional, path, None) |
| 125 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 126 |
|
| 127 |
|
| 128 |
timeout (optional, int, 30) |
| 129 |
The socket level timeout in seconds. |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
Notes |
| 136 |
----- |
| 137 |
|
| 138 |
.. note:: |
| 139 |
- For \ :literal:`idrac\_reset`\ , the job triggers only the iDRAC reset operation and does not track the complete reset cycle. |
| 140 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 141 |
- This module supports \ :literal:`check\_mode`\ . |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
Examples |
| 147 |
-------- |
| 148 |
|
| 149 |
.. code-block:: yaml+jinja |
| 150 |
|
| 151 |
|
| 152 |
--- |
| 153 |
- name: Refresh Inventory |
| 154 |
dellemc.openmanage.ome_devices: |
| 155 |
hostname: "192.168.0.1" |
| 156 |
username: "username" |
| 157 |
password: "password" |
| 158 |
ca_path: "/path/to/ca_cert.pem" |
| 159 |
device_action: refresh_inventory |
| 160 |
device_service_tags: |
| 161 |
- SVCTAG1 |
| 162 |
|
| 163 |
- name: Clear iDRAC job queue |
| 164 |
dellemc.openmanage.ome_devices: |
| 165 |
hostname: "192.168.0.1" |
| 166 |
username: "username" |
| 167 |
password: "password" |
| 168 |
ca_path: "/path/to/ca_cert.pem" |
| 169 |
device_action: clear_idrac_job_queue |
| 170 |
device_service_tags: |
| 171 |
- SVCTAG1 |
| 172 |
|
| 173 |
- name: Reset iDRAC using the service tag |
| 174 |
dellemc.openmanage.ome_devices: |
| 175 |
hostname: "192.168.0.1" |
| 176 |
username: "username" |
| 177 |
password: "password" |
| 178 |
ca_path: "/path/to/ca_cert.pem" |
| 179 |
device_action: reset_idrac |
| 180 |
device_service_tags: |
| 181 |
- SVCTAG1 |
| 182 |
|
| 183 |
- name: Remove devices using servicetags |
| 184 |
dellemc.openmanage.ome_devices: |
| 185 |
hostname: "192.168.0.1" |
| 186 |
username: "username" |
| 187 |
password: "password" |
| 188 |
ca_path: "/path/to/ca_cert.pem" |
| 189 |
state: absent |
| 190 |
device_service_tags: |
| 191 |
- SVCTAG1 |
| 192 |
- SVCTAF2 |
| 193 |
|
| 194 |
- name: Remove devices using IDs |
| 195 |
dellemc.openmanage.ome_devices: |
| 196 |
hostname: "192.168.0.1" |
| 197 |
username: "username" |
| 198 |
password: "password" |
| 199 |
ca_path: "/path/to/ca_cert.pem" |
| 200 |
state: absent |
| 201 |
device_ids: |
| 202 |
- 10235 |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
Return Values |
| 207 |
------------- |
| 208 |
|
| 209 |
msg (always, str, Successfully removed the device(s).) |
| 210 |
Overall status of the devices operation. |
| 211 |
|
| 212 |
|
| 213 |
job (success, dict, {'Id': 14874, 'JobName': 'Refresh inventory', 'JobDescription': "The Refresh inventory task initiated from OpenManage Ansible Modules for devices with the ids '13216'.", 'Schedule': 'startnow', 'State': 'Enabled', 'CreatedBy': 'admin', 'UpdatedBy': None, 'Visible': True, 'Editable': True, 'Builtin': False, 'UserGenerated': True, 'Targets': [{'JobId': 14874, 'Id': 13216, 'Data': '', 'TargetType': {'Id': 1000, 'Name': 'DEVICE'}}], 'Params': [{'JobId': 14874, 'Key': 'action', 'Value': 'CONFIG_INVENTORY'}, {'JobId': 14874, 'Key': 'isCollectDriverInventory', 'Value': 'true'}], 'LastRunStatus': {'@odata.type': '#JobService.JobStatus', 'Id': 2060, 'Name': 'Completed'}, 'JobType': {'@odata.type': '#JobService.JobType', 'Id': 8, 'Name': 'Inventory_Task', 'Internal': False}, 'JobStatus': {'@odata.type': '#JobService.JobStatus', 'Id': 2020, 'Name': 'Scheduled'}, '[email protected]': '/api/JobService/Jobs(14874)/ExecutionHistories', 'LastExecutionDetail': {'@odata.id': '/api/JobService/Jobs(14874)/LastExecutionDetail'}}) |
| 214 |
Job details of the devices operation. |
| 215 |
|
| 216 |
|
| 217 |
error_info (on HTTP error, dict, {'error': {'code': 'Base.1.0.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information.', '@Message.ExtendedInfo': [{'MessageId': 'CGEN1002', 'RelatedProperties': [], 'Message': 'Unable to complete the operation because the requested URI is invalid.', 'MessageArgs': [], 'Severity': 'Critical', 'Resolution': 'Enter a valid URI and retry the operation.'}]}}) |
| 218 |
Details of the HTTP Error. |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
Status |
| 225 |
------ |
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
Authors |
| 232 |
~~~~~~~ |
| 233 |
|
| 234 |
- Jagadeesh N V(@jagadeeshnv) |
| 235 |
- ShivamSh3(@ShivamSh3) |
| 236 |
|