| 1 |
.. _ome_groups_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_groups -- Manages static device groups on OpenManage Enterprise |
| 5 |
=================================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module allows to create, modify, and delete static device groups 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 |
|
| 25 |
|
| 26 |
|
| 27 |
Parameters |
| 28 |
---------- |
| 29 |
|
| 30 |
state (optional, str, present) |
| 31 |
\ :literal:`present`\ allows to create or modify a device group. |
| 32 |
|
| 33 |
\ :literal:`absent`\ allows to delete a device group. |
| 34 |
|
| 35 |
|
| 36 |
name (optional, list, None) |
| 37 |
Name of the device group to be created, modified, or deleted. |
| 38 |
|
| 39 |
If \ :emphasis:`state`\ is absent, multiple names can be provided. |
| 40 |
|
| 41 |
This option is case insensitive. |
| 42 |
|
| 43 |
This option is mutually exclusive with \ :emphasis:`group\_id`\ . |
| 44 |
|
| 45 |
|
| 46 |
group_id (optional, list, None) |
| 47 |
ID of the device group to be created, modified, or deleted. |
| 48 |
|
| 49 |
If \ :emphasis:`state`\ is absent, multiple IDs can be provided. |
| 50 |
|
| 51 |
This option is mutually exclusive with \ :emphasis:`name`\ . |
| 52 |
|
| 53 |
|
| 54 |
new_name (optional, str, None) |
| 55 |
New name for the existing device group. |
| 56 |
|
| 57 |
This is applicable only when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 58 |
|
| 59 |
|
| 60 |
description (optional, str, None) |
| 61 |
Description for the device group. |
| 62 |
|
| 63 |
This is applicable only when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 64 |
|
| 65 |
|
| 66 |
parent_group_name (optional, str, Static Groups) |
| 67 |
Name of the parent device group under which the device group to be created or modified. |
| 68 |
|
| 69 |
This is applicable only when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 70 |
|
| 71 |
\ :literal:`NOTE`\ If device group with such a name does not exist, device group with \ :emphasis:`parent\_group\_name`\ is created. |
| 72 |
|
| 73 |
This option is case insensitive. |
| 74 |
|
| 75 |
This option is mutually exclusive with \ :emphasis:`parent\_group\_id`\ . |
| 76 |
|
| 77 |
|
| 78 |
parent_group_id (optional, int, None) |
| 79 |
ID of the parent device group under which the device group to be created or modified. |
| 80 |
|
| 81 |
This is applicable only when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 82 |
|
| 83 |
This option is mutually exclusive with \ :emphasis:`parent\_group\_name`\ . |
| 84 |
|
| 85 |
|
| 86 |
hostname (True, str, None) |
| 87 |
OpenManage Enterprise IP address or hostname. |
| 88 |
|
| 89 |
|
| 90 |
username (False, str, None) |
| 91 |
OpenManage Enterprise username. |
| 92 |
|
| 93 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 94 |
|
| 95 |
Example: export OME\_USERNAME=username |
| 96 |
|
| 97 |
|
| 98 |
password (False, str, None) |
| 99 |
OpenManage Enterprise password. |
| 100 |
|
| 101 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 102 |
|
| 103 |
Example: export OME\_PASSWORD=password |
| 104 |
|
| 105 |
|
| 106 |
x_auth_token (False, str, None) |
| 107 |
Authentication token. |
| 108 |
|
| 109 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 110 |
|
| 111 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 112 |
|
| 113 |
|
| 114 |
port (optional, int, 443) |
| 115 |
OpenManage Enterprise HTTPS port. |
| 116 |
|
| 117 |
|
| 118 |
validate_certs (optional, bool, True) |
| 119 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 120 |
|
| 121 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 122 |
|
| 123 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 124 |
|
| 125 |
|
| 126 |
ca_path (optional, path, None) |
| 127 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 128 |
|
| 129 |
|
| 130 |
timeout (optional, int, 30) |
| 131 |
The socket level timeout in seconds. |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
Notes |
| 138 |
----- |
| 139 |
|
| 140 |
.. note:: |
| 141 |
- This module manages only static device groups on Dell OpenManage Enterprise. |
| 142 |
- If a device group with the name \ :emphasis:`parent\_group\_name`\ does not exist, a new device group with the same name is created. |
| 143 |
- Make sure the entered parent group is not the descendant of the provided group. |
| 144 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 145 |
- This module supports \ :literal:`check\_mode`\ . |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
Examples |
| 151 |
-------- |
| 152 |
|
| 153 |
.. code-block:: yaml+jinja |
| 154 |
|
| 155 |
|
| 156 |
--- |
| 157 |
- name: Create a new device group |
| 158 |
dellemc.openmanage.ome_groups: |
| 159 |
hostname: "192.168.0.1" |
| 160 |
username: "username" |
| 161 |
password: "password" |
| 162 |
ca_path: "/path/to/ca_cert.pem" |
| 163 |
name: "group 1" |
| 164 |
description: "Group 1 description" |
| 165 |
parent_group_name: "group parent 1" |
| 166 |
|
| 167 |
- name: Modify a device group using the group ID |
| 168 |
dellemc.openmanage.ome_groups: |
| 169 |
hostname: "192.168.0.1" |
| 170 |
username: "username" |
| 171 |
password: "password" |
| 172 |
ca_path: "/path/to/ca_cert.pem" |
| 173 |
group_id: 1234 |
| 174 |
description: "Group description updated" |
| 175 |
parent_group_name: "group parent 2" |
| 176 |
|
| 177 |
- name: Delete a device group using the device group name |
| 178 |
dellemc.openmanage.ome_groups: |
| 179 |
hostname: "192.168.0.1" |
| 180 |
username: "username" |
| 181 |
password: "password" |
| 182 |
ca_path: "/path/to/ca_cert.pem" |
| 183 |
state: absent |
| 184 |
name: "group 1" |
| 185 |
|
| 186 |
- name: Delete multiple device groups using the group IDs |
| 187 |
dellemc.openmanage.ome_groups: |
| 188 |
hostname: "192.168.0.1" |
| 189 |
username: "username" |
| 190 |
password: "password" |
| 191 |
ca_path: "/path/to/ca_cert.pem" |
| 192 |
state: absent |
| 193 |
group_id: |
| 194 |
- 1234 |
| 195 |
- 5678 |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
Return Values |
| 200 |
------------- |
| 201 |
|
| 202 |
msg (always, str, Successfully deleted the device group(s).) |
| 203 |
Overall status of the device group operation. |
| 204 |
|
| 205 |
|
| 206 |
group_status (success, dict, {'Description': 'my group description', 'Id': 12123, 'MembershipTypeId': 12, 'Name': 'group 1', 'ParentId': 12345, 'TypeId': 3000, 'IdOwner': 30, 'CreatedBy': 'admin', 'CreationTime': '2021-01-01 10:10:10.100', 'DefinitionDescription': 'UserDefined', 'DefinitionId': 400, 'GlobalStatus': 5000, 'HasAttributes': False, 'UpdatedBy': '', 'UpdatedTime': '2021-01-01 11:11:10.100', 'Visible': True}) |
| 207 |
Details of the device group operation status. |
| 208 |
|
| 209 |
|
| 210 |
group_ids (when I(state) is C(absent), list, [1234, 5678]) |
| 211 |
List of the deleted device group IDs. |
| 212 |
|
| 213 |
|
| 214 |
invalid_groups (when I(state) is C(absent), list, [1234, 5678]) |
| 215 |
List of the invalid device group IDs or names. |
| 216 |
|
| 217 |
|
| 218 |
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': 'CGRP9013', 'RelatedProperties': [], 'Message': 'Unable to update group 12345 with the provided parent 54321 because a group/parent relationship already exists.', 'MessageArgs': ['12345', '54321'], 'Severity': 'Warning', 'Resolution': 'Make sure the entered parent ID does not create a bidirectional relationship and retry the operation.'}]}}) |
| 219 |
Details of the HTTP Error. |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
Status |
| 226 |
------ |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
Authors |
| 233 |
~~~~~~~ |
| 234 |
|
| 235 |
- Jagadeesh N V(@jagadeeshnv) |
| 236 |
- Mangirish Kenkare(@MangirishK) |
| 237 |
|