| 1 |
.. _ome_device_group_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_device_group -- Add or remove device(s) from a static device group on OpenManage Enterprise |
| 5 |
=============================================================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module allows to add or remove device(s) from a static device group on 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 |
- netaddr \>= 0.7.19 |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
Parameters |
| 29 |
---------- |
| 30 |
|
| 31 |
state (optional, str, present) |
| 32 |
\ :literal:`present`\ allows to add the device(s) to a static device group. |
| 33 |
|
| 34 |
\ :literal:`absent`\ allows to remove the device(s) from a static device group. |
| 35 |
|
| 36 |
|
| 37 |
name (optional, str, None) |
| 38 |
Name of the static group. |
| 39 |
|
| 40 |
\ :emphasis:`name`\ is mutually exclusive with \ :emphasis:`group\_id`\ . |
| 41 |
|
| 42 |
|
| 43 |
group_id (optional, int, None) |
| 44 |
ID of the static device. |
| 45 |
|
| 46 |
\ :emphasis:`group\_id`\ is mutually exclusive with \ :emphasis:`name`\ . |
| 47 |
|
| 48 |
|
| 49 |
device_ids (optional, list, None) |
| 50 |
List of ID(s) of the device(s) to be added or removed from the device group. |
| 51 |
|
| 52 |
\ :emphasis:`device\_ids`\ is mutually exclusive with \ :emphasis:`device\_service\_tags`\ and \ :emphasis:`ip\_addresses`\ . |
| 53 |
|
| 54 |
|
| 55 |
device_service_tags (optional, list, None) |
| 56 |
List of service tag(s) of the device(s) to be added or removed from the device group. |
| 57 |
|
| 58 |
\ :emphasis:`device\_service\_tags`\ is mutually exclusive with \ :emphasis:`device\_ids`\ and \ :emphasis:`ip\_addresses`\ . |
| 59 |
|
| 60 |
|
| 61 |
ip_addresses (optional, list, None) |
| 62 |
List of IPs of the device(s) to be added or removed from the device group. |
| 63 |
|
| 64 |
\ :emphasis:`ip\_addresses`\ is mutually exclusive with \ :emphasis:`device\_ids`\ and \ :emphasis:`device\_service\_tags`\ . |
| 65 |
|
| 66 |
Supported IP address range formats: |
| 67 |
|
| 68 |
- 192.35.0.1 |
| 69 |
|
| 70 |
- 10.36.0.0-192.36.0.255 |
| 71 |
|
| 72 |
- 192.37.0.0/24 |
| 73 |
|
| 74 |
- fe80::ffff:ffff:ffff:ffff |
| 75 |
|
| 76 |
- fe80::ffff:192.0.2.0/125 |
| 77 |
|
| 78 |
- fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff |
| 79 |
|
| 80 |
\ :literal:`NOTE`\ Hostname is not supported. |
| 81 |
|
| 82 |
\ :literal:`NOTE`\ \ :emphasis:`ip\_addresses`\ requires python's netaddr packages to work on IP Addresses. |
| 83 |
|
| 84 |
\ :literal:`NOTE`\ This module reports success even if one of the IP addresses provided in the \ :emphasis:`ip\_addresses`\ list is available in OpenManage Enterprise.The module reports failure only if none of the IP addresses provided in the list are available in OpenManage Enterprise. |
| 85 |
|
| 86 |
|
| 87 |
hostname (True, str, None) |
| 88 |
OpenManage Enterprise IP address or hostname. |
| 89 |
|
| 90 |
|
| 91 |
username (False, str, None) |
| 92 |
OpenManage Enterprise username. |
| 93 |
|
| 94 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 95 |
|
| 96 |
Example: export OME\_USERNAME=username |
| 97 |
|
| 98 |
|
| 99 |
password (False, str, None) |
| 100 |
OpenManage Enterprise password. |
| 101 |
|
| 102 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 103 |
|
| 104 |
Example: export OME\_PASSWORD=password |
| 105 |
|
| 106 |
|
| 107 |
x_auth_token (False, str, None) |
| 108 |
Authentication token. |
| 109 |
|
| 110 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 111 |
|
| 112 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 113 |
|
| 114 |
|
| 115 |
port (optional, int, 443) |
| 116 |
OpenManage Enterprise HTTPS port. |
| 117 |
|
| 118 |
|
| 119 |
validate_certs (optional, bool, True) |
| 120 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 121 |
|
| 122 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 123 |
|
| 124 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 125 |
|
| 126 |
|
| 127 |
ca_path (optional, path, None) |
| 128 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 129 |
|
| 130 |
|
| 131 |
timeout (optional, int, 30) |
| 132 |
The socket level timeout in seconds. |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
Notes |
| 139 |
----- |
| 140 |
|
| 141 |
.. note:: |
| 142 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 143 |
- This module supports \ :literal:`check\_mode`\ . |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
Examples |
| 149 |
-------- |
| 150 |
|
| 151 |
.. code-block:: yaml+jinja |
| 152 |
|
| 153 |
|
| 154 |
--- |
| 155 |
- name: Add devices to a static device group by using the group name and device IDs |
| 156 |
dellemc.openmanage.ome_device_group: |
| 157 |
hostname: "192.168.0.1" |
| 158 |
username: "username" |
| 159 |
password: "password" |
| 160 |
ca_path: "/path/to/ca_cert.pem" |
| 161 |
name: "Storage Services" |
| 162 |
device_ids: |
| 163 |
- 11111 |
| 164 |
- 11112 |
| 165 |
- 11113 |
| 166 |
|
| 167 |
- name: Add devices to a static device group by using the group name and device service tags |
| 168 |
dellemc.openmanage.ome_device_group: |
| 169 |
hostname: "192.168.0.1" |
| 170 |
username: "username" |
| 171 |
password: "password" |
| 172 |
ca_path: "/path/to/ca_cert.pem" |
| 173 |
name: "Storage Services" |
| 174 |
device_service_tags: |
| 175 |
- GHRT2RL |
| 176 |
- KJHDF3S |
| 177 |
- LKIJNG6 |
| 178 |
|
| 179 |
- name: Add devices to a static device group by using the group ID and device service tags |
| 180 |
dellemc.openmanage.ome_device_group: |
| 181 |
hostname: "192.168.0.1" |
| 182 |
username: "username" |
| 183 |
password: "password" |
| 184 |
ca_path: "/path/to/ca_cert.pem" |
| 185 |
group_id: 12345 |
| 186 |
device_service_tags: |
| 187 |
- GHRT2RL |
| 188 |
- KJHDF3S |
| 189 |
|
| 190 |
- name: Add devices to a static device group by using the group name and IPv4 addresses |
| 191 |
dellemc.openmanage.ome_device_group: |
| 192 |
hostname: "192.168.0.1" |
| 193 |
username: "username" |
| 194 |
password: "password" |
| 195 |
ca_path: "/path/to/ca_cert.pem" |
| 196 |
name: "Storage Services" |
| 197 |
ip_addresses: |
| 198 |
- 192.35.0.1 |
| 199 |
- 192.35.0.5 |
| 200 |
|
| 201 |
- name: Add devices to a static device group by using the group ID and IPv6 addresses |
| 202 |
dellemc.openmanage.ome_device_group: |
| 203 |
hostname: "192.168.0.1" |
| 204 |
username: "username" |
| 205 |
password: "password" |
| 206 |
ca_path: "/path/to/ca_cert.pem" |
| 207 |
group_id: 12345 |
| 208 |
ip_addresses: |
| 209 |
- fe80::ffff:ffff:ffff:ffff |
| 210 |
- fe80::ffff:ffff:ffff:2222 |
| 211 |
|
| 212 |
- name: Add devices to a static device group by using the group ID and supported IPv4 and IPv6 address formats. |
| 213 |
dellemc.openmanage.ome_device_group: |
| 214 |
hostname: "192.168.0.1" |
| 215 |
username: "username" |
| 216 |
password: "password" |
| 217 |
ca_path: "/path/to/ca_cert.pem" |
| 218 |
group_id: 12345 |
| 219 |
ip_addresses: |
| 220 |
- 192.35.0.1 |
| 221 |
- 10.36.0.0-192.36.0.255 |
| 222 |
- 192.37.0.0/24 |
| 223 |
- fe80::ffff:ffff:ffff:ffff |
| 224 |
- ::ffff:192.0.2.0/125 |
| 225 |
- fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff |
| 226 |
|
| 227 |
- name: Remove devices from a static device group by using the group name and device IDs |
| 228 |
dellemc.openmanage.ome_device_group: |
| 229 |
hostname: "192.168.0.1" |
| 230 |
username: "username" |
| 231 |
password: "password" |
| 232 |
ca_path: "/path/to/ca_cert.pem" |
| 233 |
state: "absent" |
| 234 |
name: "Storage Services" |
| 235 |
device_ids: |
| 236 |
- 11111 |
| 237 |
- 11112 |
| 238 |
- 11113 |
| 239 |
|
| 240 |
- name: Remove devices from a static device group by using the group name and device service tags |
| 241 |
dellemc.openmanage.ome_device_group: |
| 242 |
hostname: "192.168.0.1" |
| 243 |
username: "username" |
| 244 |
password: "password" |
| 245 |
ca_path: "/path/to/ca_cert.pem" |
| 246 |
state: "absent" |
| 247 |
name: "Storage Services" |
| 248 |
device_service_tags: |
| 249 |
- GHRT2RL |
| 250 |
- KJHDF3S |
| 251 |
- LKIJNG6 |
| 252 |
|
| 253 |
- name: Remove devices from a static device group by using the group ID and device service tags |
| 254 |
dellemc.openmanage.ome_device_group: |
| 255 |
hostname: "192.168.0.1" |
| 256 |
username: "username" |
| 257 |
password: "password" |
| 258 |
ca_path: "/path/to/ca_cert.pem" |
| 259 |
state: "absent" |
| 260 |
group_id: 12345 |
| 261 |
device_service_tags: |
| 262 |
- GHRT2RL |
| 263 |
- KJHDF3S |
| 264 |
|
| 265 |
- name: Remove devices from a static device group by using the group name and IPv4 addresses |
| 266 |
dellemc.openmanage.ome_device_group: |
| 267 |
hostname: "192.168.0.1" |
| 268 |
username: "username" |
| 269 |
password: "password" |
| 270 |
ca_path: "/path/to/ca_cert.pem" |
| 271 |
state: "absent" |
| 272 |
name: "Storage Services" |
| 273 |
ip_addresses: |
| 274 |
- 192.35.0.1 |
| 275 |
- 192.35.0.5 |
| 276 |
|
| 277 |
- name: Remove devices from a static device group by using the group ID and IPv6 addresses |
| 278 |
dellemc.openmanage.ome_device_group: |
| 279 |
hostname: "192.168.0.1" |
| 280 |
username: "username" |
| 281 |
password: "password" |
| 282 |
ca_path: "/path/to/ca_cert.pem" |
| 283 |
state: "absent" |
| 284 |
group_id: 12345 |
| 285 |
ip_addresses: |
| 286 |
- fe80::ffff:ffff:ffff:ffff |
| 287 |
- fe80::ffff:ffff:ffff:2222 |
| 288 |
|
| 289 |
- name: Remove devices from a static device group by using the group ID and supported IPv4 and IPv6 address formats. |
| 290 |
dellemc.openmanage.ome_device_group: |
| 291 |
hostname: "192.168.0.1" |
| 292 |
username: "username" |
| 293 |
password: "password" |
| 294 |
ca_path: "/path/to/ca_cert.pem" |
| 295 |
state: "absent" |
| 296 |
group_id: 12345 |
| 297 |
ip_addresses: |
| 298 |
- 192.35.0.1 |
| 299 |
- 10.36.0.0-192.36.0.255 |
| 300 |
- 192.37.0.0/24 |
| 301 |
- fe80::ffff:ffff:ffff:ffff |
| 302 |
- ::ffff:192.0.2.0/125 |
| 303 |
- fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
Return Values |
| 308 |
------------- |
| 309 |
|
| 310 |
msg (always, str, ['Successfully added member(s) to the device group.']) |
| 311 |
Overall status of the device group settings. |
| 312 |
|
| 313 |
|
| 314 |
group_id (success, int, 21078) |
| 315 |
ID of the group. |
| 316 |
|
| 317 |
|
| 318 |
ip_addresses_added (success, list, 21078) |
| 319 |
IP Addresses which are added to the device group. |
| 320 |
|
| 321 |
|
| 322 |
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': 'GEN1234', 'RelatedProperties': [], 'Message': 'Unable to process the request because an error occurred.', 'MessageArgs': [], 'Severity': 'Critical', 'Resolution': 'Retry the operation. If the issue persists, contact your system administrator.'}]}}) |
| 323 |
Details of the HTTP Error. |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
Status |
| 330 |
------ |
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
Authors |
| 337 |
~~~~~~~ |
| 338 |
|
| 339 |
- Felix Stephen (@felixs88) |
| 340 |
- Sajna Shetty(@Sajna-Shetty) |
| 341 |
- Abhishek Sinha (@Abhishek-Dell) |
| 342 |
- Sapana Gupta (@sapana05) |
| 343 |
|