| 1 |
.. _ome_profile_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_profile -- Create, modify, delete, assign, unassign and migrate a profile 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, delete, assign, unassign, and migrate a profile 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 |
command (optional, str, create) |
| 31 |
\ :literal:`create`\ creates new profiles. |
| 32 |
|
| 33 |
\ :literal:`modify`\ modifies an existing profile. Only \ :emphasis:`name`\ , \ :emphasis:`description`\ , \ :emphasis:`boot\_to\_network\_iso`\ , and \ :emphasis:`attributes`\ can be modified. |
| 34 |
|
| 35 |
\ :literal:`delete`\ deletes an existing profile. |
| 36 |
|
| 37 |
\ :literal:`assign`\ Deploys an existing profile on a target device and returns a task ID. |
| 38 |
|
| 39 |
\ :literal:`unassign`\ unassigns a profile from a specified target and returns a task ID. |
| 40 |
|
| 41 |
\ :literal:`migrate`\ migrates an existing profile and returns a task ID. |
| 42 |
|
| 43 |
|
| 44 |
name_prefix (optional, str, Profile) |
| 45 |
The name provided when creating a profile is used a prefix followed by the number assigned to it by OpenManage Enterprise. |
| 46 |
|
| 47 |
This is applicable only for a create operation. |
| 48 |
|
| 49 |
This option is mutually exclusive with \ :emphasis:`name`\ . |
| 50 |
|
| 51 |
|
| 52 |
name (optional, str, None) |
| 53 |
Name of the profile. |
| 54 |
|
| 55 |
This is applicable for modify, delete, assign, unassign, and migrate operations. |
| 56 |
|
| 57 |
This option is mutually exclusive with \ :emphasis:`name\_prefix`\ and \ :emphasis:`number\_of\_profiles`\ . |
| 58 |
|
| 59 |
|
| 60 |
new_name (optional, str, None) |
| 61 |
New name of the profile. |
| 62 |
|
| 63 |
Applicable when \ :emphasis:`command`\ is \ :literal:`modify`\ . |
| 64 |
|
| 65 |
|
| 66 |
number_of_profiles (optional, int, 1) |
| 67 |
Provide the number of profiles to be created. |
| 68 |
|
| 69 |
This is applicable when \ :emphasis:`name\_prefix`\ is used with \ :literal:`create`\ . |
| 70 |
|
| 71 |
This option is mutually exclusive with \ :emphasis:`name`\ . |
| 72 |
|
| 73 |
Openmanage Enterprise can create a maximum of 100 profiles. |
| 74 |
|
| 75 |
|
| 76 |
template_name (optional, str, None) |
| 77 |
Name of the template for creating the profile(s). |
| 78 |
|
| 79 |
This is applicable when \ :emphasis:`command`\ is \ :literal:`create`\ . |
| 80 |
|
| 81 |
This option is mutually exclusive with \ :emphasis:`template\_id`\ . |
| 82 |
|
| 83 |
|
| 84 |
template_id (optional, int, None) |
| 85 |
ID of the template. |
| 86 |
|
| 87 |
This is applicable when \ :emphasis:`command`\ is \ :literal:`create`\ . |
| 88 |
|
| 89 |
This option is mutually exclusive with \ :emphasis:`template\_name`\ . |
| 90 |
|
| 91 |
|
| 92 |
device_id (optional, int, None) |
| 93 |
ID of the target device. |
| 94 |
|
| 95 |
This is applicable when \ :emphasis:`command`\ is \ :literal:`assign`\ and \ :literal:`migrate`\ . |
| 96 |
|
| 97 |
This option is mutually exclusive with \ :emphasis:`device\_service\_tag`\ . |
| 98 |
|
| 99 |
|
| 100 |
device_service_tag (optional, str, None) |
| 101 |
Identifier of the target device. |
| 102 |
|
| 103 |
This is typically 7 to 8 characters in length. |
| 104 |
|
| 105 |
Applicable when \ :emphasis:`command`\ is \ :literal:`assign`\ , and \ :literal:`migrate`\ . |
| 106 |
|
| 107 |
This option is mutually exclusive with \ :emphasis:`device\_id`\ . |
| 108 |
|
| 109 |
If the device does not exist when \ :emphasis:`command`\ is \ :literal:`assign`\ then the profile is auto-deployed. |
| 110 |
|
| 111 |
|
| 112 |
description (optional, str, None) |
| 113 |
Description of the profile. |
| 114 |
|
| 115 |
|
| 116 |
boot_to_network_iso (optional, dict, None) |
| 117 |
Details of the Share iso. |
| 118 |
|
| 119 |
Applicable when \ :emphasis:`command`\ is \ :literal:`create`\ , \ :literal:`assign`\ , and \ :literal:`modify`\ . |
| 120 |
|
| 121 |
|
| 122 |
boot_to_network (True, bool, None) |
| 123 |
Enable or disable a network share. |
| 124 |
|
| 125 |
|
| 126 |
share_type (optional, str, None) |
| 127 |
Type of network share. |
| 128 |
|
| 129 |
|
| 130 |
share_ip (optional, str, None) |
| 131 |
IP address of the network share. |
| 132 |
|
| 133 |
|
| 134 |
share_user (optional, str, None) |
| 135 |
User name when \ :emphasis:`share\_type`\ is \ :literal:`CIFS`\ . |
| 136 |
|
| 137 |
|
| 138 |
share_password (optional, str, None) |
| 139 |
User password when \ :emphasis:`share\_type`\ is \ :literal:`CIFS`\ . |
| 140 |
|
| 141 |
|
| 142 |
workgroup (optional, str, None) |
| 143 |
User workgroup when \ :emphasis:`share\_type`\ is \ :literal:`CIFS`\ . |
| 144 |
|
| 145 |
|
| 146 |
iso_path (optional, str, None) |
| 147 |
Specify the full ISO path including the share name. |
| 148 |
|
| 149 |
|
| 150 |
iso_timeout (optional, int, 4) |
| 151 |
Set the number of hours that the network ISO file will remain mapped to the target device(s). |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
filters (optional, dict, None) |
| 156 |
Filters the profiles based on selected criteria. |
| 157 |
|
| 158 |
This is applicable when \ :emphasis:`command`\ is \ :literal:`delete`\ or \ :literal:`unassign`\ . |
| 159 |
|
| 160 |
This supports suboption \ :emphasis:`ProfileIds`\ which takes a list of profile IDs. |
| 161 |
|
| 162 |
This also supports OData filter expressions with the suboption \ :emphasis:`Filters`\ . |
| 163 |
|
| 164 |
See OpenManage Enterprise REST API guide for the filtering options available. |
| 165 |
|
| 166 |
\ :emphasis:`WARNING`\ When this option is used in case of \ :literal:`unassign`\ , task ID is not returned for any of the profiles affected. |
| 167 |
|
| 168 |
|
| 169 |
force (optional, bool, False) |
| 170 |
Provides the option to force the migration of a profile even if the source device cannot be contacted. |
| 171 |
|
| 172 |
This option is applicable when \ :emphasis:`command`\ is \ :literal:`migrate`\ . |
| 173 |
|
| 174 |
|
| 175 |
attributes (optional, dict, None) |
| 176 |
Attributes for \ :literal:`modify`\ and \ :literal:`assign`\ . |
| 177 |
|
| 178 |
|
| 179 |
Attributes (optional, list, None) |
| 180 |
List of attributes to be modified, when \ :emphasis:`command`\ is \ :literal:`modify`\ . |
| 181 |
|
| 182 |
List of attributes to be overridden when \ :emphasis:`command`\ is \ :literal:`assign`\ . |
| 183 |
|
| 184 |
Use the \ :emphasis:`Id`\ If the attribute Id is available. If not, use the comma separated I (DisplayName). For more details about using the \ :emphasis:`DisplayName`\ , see the example provided. |
| 185 |
|
| 186 |
|
| 187 |
Options (optional, dict, None) |
| 188 |
Provides the different shut down options. |
| 189 |
|
| 190 |
This is applicable when \ :emphasis:`command`\ is \ :literal:`assign`\ . |
| 191 |
|
| 192 |
|
| 193 |
Schedule (optional, dict, None) |
| 194 |
Schedule for profile deployment. |
| 195 |
|
| 196 |
This is applicable when \ :emphasis:`command`\ is \ :literal:`assign`\ . |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
hostname (True, str, None) |
| 201 |
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
| 202 |
|
| 203 |
|
| 204 |
username (False, str, None) |
| 205 |
OpenManage Enterprise or OpenManage Enterprise Modular username. |
| 206 |
|
| 207 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 208 |
|
| 209 |
Example: export OME\_USERNAME=username |
| 210 |
|
| 211 |
|
| 212 |
password (False, str, None) |
| 213 |
OpenManage Enterprise or OpenManage Enterprise Modular password. |
| 214 |
|
| 215 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 216 |
|
| 217 |
Example: export OME\_PASSWORD=password |
| 218 |
|
| 219 |
|
| 220 |
x_auth_token (False, str, None) |
| 221 |
Authentication token. |
| 222 |
|
| 223 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 224 |
|
| 225 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 226 |
|
| 227 |
|
| 228 |
port (optional, int, 443) |
| 229 |
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. |
| 230 |
|
| 231 |
|
| 232 |
validate_certs (optional, bool, True) |
| 233 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 234 |
|
| 235 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 236 |
|
| 237 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 238 |
|
| 239 |
|
| 240 |
ca_path (optional, path, None) |
| 241 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 242 |
|
| 243 |
|
| 244 |
timeout (optional, int, 30) |
| 245 |
The socket level timeout in seconds. |
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
Notes |
| 252 |
----- |
| 253 |
|
| 254 |
.. note:: |
| 255 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 256 |
- This module supports \ :literal:`check\_mode`\ . |
| 257 |
- \ :literal:`assign`\ operation on a already assigned profile will not redeploy. |
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
Examples |
| 263 |
-------- |
| 264 |
|
| 265 |
.. code-block:: yaml+jinja |
| 266 |
|
| 267 |
|
| 268 |
--- |
| 269 |
- name: Create two profiles from a template |
| 270 |
dellemc.openmanage.ome_profile: |
| 271 |
hostname: "192.168.0.1" |
| 272 |
username: "username" |
| 273 |
password: "password" |
| 274 |
ca_path: "/path/to/ca_cert.pem" |
| 275 |
template_name: "template 1" |
| 276 |
name_prefix: "omam_profile" |
| 277 |
number_of_profiles: 2 |
| 278 |
|
| 279 |
- name: Create profile with NFS share |
| 280 |
dellemc.openmanage.ome_profile: |
| 281 |
hostname: "192.168.0.1" |
| 282 |
username: "username" |
| 283 |
password: "password" |
| 284 |
ca_path: "/path/to/ca_cert.pem" |
| 285 |
command: create |
| 286 |
template_name: "template 1" |
| 287 |
name_prefix: "omam_profile" |
| 288 |
number_of_profiles: 1 |
| 289 |
boot_to_network_iso: |
| 290 |
boot_to_network: true |
| 291 |
share_type: NFS |
| 292 |
share_ip: "192.168.0.1" |
| 293 |
iso_path: "path/to/my_iso.iso" |
| 294 |
iso_timeout: 8 |
| 295 |
|
| 296 |
- name: Create profile with CIFS share |
| 297 |
dellemc.openmanage.ome_profile: |
| 298 |
hostname: "192.168.0.1" |
| 299 |
username: "username" |
| 300 |
password: "password" |
| 301 |
ca_path: "/path/to/ca_cert.pem" |
| 302 |
command: create |
| 303 |
template_name: "template 1" |
| 304 |
name_prefix: "omam_profile" |
| 305 |
number_of_profiles: 1 |
| 306 |
boot_to_network_iso: |
| 307 |
boot_to_network: true |
| 308 |
share_type: CIFS |
| 309 |
share_ip: "192.168.0.2" |
| 310 |
share_user: "username" |
| 311 |
share_password: "password" |
| 312 |
workgroup: "workgroup" |
| 313 |
iso_path: "\\path\\to\\my_iso.iso" |
| 314 |
iso_timeout: 8 |
| 315 |
|
| 316 |
- name: Modify profile name with NFS share and attributes |
| 317 |
dellemc.openmanage.ome_profile: |
| 318 |
hostname: "192.168.0.1" |
| 319 |
username: "username" |
| 320 |
password: "password" |
| 321 |
ca_path: "/path/to/ca_cert.pem" |
| 322 |
command: modify |
| 323 |
name: "Profile 00001" |
| 324 |
new_name: "modified profile" |
| 325 |
description: "new description" |
| 326 |
boot_to_network_iso: |
| 327 |
boot_to_network: true |
| 328 |
share_type: NFS |
| 329 |
share_ip: "192.168.0.3" |
| 330 |
iso_path: "path/to/my_iso.iso" |
| 331 |
iso_timeout: 8 |
| 332 |
attributes: |
| 333 |
Attributes: |
| 334 |
- Id: 4506 |
| 335 |
Value: "server attr 1" |
| 336 |
IsIgnored: false |
| 337 |
- Id: 4507 |
| 338 |
Value: "server attr 2" |
| 339 |
IsIgnored: false |
| 340 |
# Enter the comma separated string as appearing in the Detailed view on GUI |
| 341 |
# System -> Server Topology -> ServerTopology 1 Aisle Name |
| 342 |
- DisplayName: 'System, Server Topology, ServerTopology 1 Aisle Name' |
| 343 |
Value: Aisle 5 |
| 344 |
IsIgnored: false |
| 345 |
|
| 346 |
- name: Delete a profile using profile name |
| 347 |
dellemc.openmanage.ome_profile: |
| 348 |
hostname: "192.168.0.1" |
| 349 |
username: "username" |
| 350 |
password: "password" |
| 351 |
ca_path: "/path/to/ca_cert.pem" |
| 352 |
command: "delete" |
| 353 |
name: "Profile 00001" |
| 354 |
|
| 355 |
- name: Delete profiles using filters |
| 356 |
dellemc.openmanage.ome_profile: |
| 357 |
hostname: "192.168.0.1" |
| 358 |
username: "username" |
| 359 |
password: "password" |
| 360 |
ca_path: "/path/to/ca_cert.pem" |
| 361 |
command: "delete" |
| 362 |
filters: |
| 363 |
SelectAll: true |
| 364 |
Filters: =contains(ProfileName,'Profile 00002') |
| 365 |
|
| 366 |
- name: Delete profiles using profile list filter |
| 367 |
dellemc.openmanage.ome_profile: |
| 368 |
hostname: "192.168.0.1" |
| 369 |
username: "username" |
| 370 |
password: "password" |
| 371 |
ca_path: "/path/to/ca_cert.pem" |
| 372 |
command: "delete" |
| 373 |
filters: |
| 374 |
ProfileIds: |
| 375 |
- 17123 |
| 376 |
- 16124 |
| 377 |
|
| 378 |
- name: Assign a profile to target along with network share |
| 379 |
dellemc.openmanage.ome_profile: |
| 380 |
hostname: "192.168.0.1" |
| 381 |
username: "username" |
| 382 |
password: "password" |
| 383 |
ca_path: "/path/to/ca_cert.pem" |
| 384 |
command: assign |
| 385 |
name: "Profile 00001" |
| 386 |
device_id: 12456 |
| 387 |
boot_to_network_iso: |
| 388 |
boot_to_network: true |
| 389 |
share_type: NFS |
| 390 |
share_ip: "192.168.0.1" |
| 391 |
iso_path: "path/to/my_iso.iso" |
| 392 |
iso_timeout: 8 |
| 393 |
attributes: |
| 394 |
Attributes: |
| 395 |
- Id: 4506 |
| 396 |
Value: "server attr 1" |
| 397 |
IsIgnored: true |
| 398 |
Options: |
| 399 |
ShutdownType: 0 |
| 400 |
TimeToWaitBeforeShutdown: 300 |
| 401 |
EndHostPowerState: 1 |
| 402 |
StrictCheckingVlan: true |
| 403 |
Schedule: |
| 404 |
RunNow: true |
| 405 |
RunLater: false |
| 406 |
|
| 407 |
- name: Unassign a profile using profile name |
| 408 |
dellemc.openmanage.ome_profile: |
| 409 |
hostname: "192.168.0.1" |
| 410 |
username: "username" |
| 411 |
password: "password" |
| 412 |
ca_path: "/path/to/ca_cert.pem" |
| 413 |
command: "unassign" |
| 414 |
name: "Profile 00003" |
| 415 |
|
| 416 |
- name: Unassign profiles using filters |
| 417 |
dellemc.openmanage.ome_profile: |
| 418 |
hostname: "192.168.0.1" |
| 419 |
username: "username" |
| 420 |
password: "password" |
| 421 |
ca_path: "/path/to/ca_cert.pem" |
| 422 |
command: "unassign" |
| 423 |
filters: |
| 424 |
SelectAll: true |
| 425 |
Filters: =contains(ProfileName,'Profile 00003') |
| 426 |
|
| 427 |
- name: Unassign profiles using profile list filter |
| 428 |
dellemc.openmanage.ome_profile: |
| 429 |
hostname: "192.168.0.1" |
| 430 |
username: "username" |
| 431 |
password: "password" |
| 432 |
ca_path: "/path/to/ca_cert.pem" |
| 433 |
command: "unassign" |
| 434 |
filters: |
| 435 |
ProfileIds: |
| 436 |
- 17123 |
| 437 |
- 16123 |
| 438 |
|
| 439 |
- name: Migrate a profile |
| 440 |
dellemc.openmanage.ome_profile: |
| 441 |
hostname: "192.168.0.1" |
| 442 |
username: "username" |
| 443 |
password: "password" |
| 444 |
ca_path: "/path/to/ca_cert.pem" |
| 445 |
command: "migrate" |
| 446 |
name: "Profile 00001" |
| 447 |
device_id: 12456 |
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
Return Values |
| 452 |
------------- |
| 453 |
|
| 454 |
msg (always, str, Successfully created 2 profile(s).) |
| 455 |
Overall status of the profile operation. |
| 456 |
|
| 457 |
|
| 458 |
profile_ids (when I(command) is C(create), list, [1234, 5678]) |
| 459 |
IDs of the profiles created. |
| 460 |
|
| 461 |
|
| 462 |
job_id (when I(command) is C(assign), C(migrate) or C(unassign), int, 14123) |
| 463 |
Task ID created when \ :emphasis:`command`\ is \ :literal:`assign`\ , \ :literal:`migrate`\ or \ :literal:`unassign`\ . |
| 464 |
|
| 465 |
\ :literal:`assign`\ and \ :literal:`unassign`\ operations do not trigger a task if a profile is auto-deployed. |
| 466 |
|
| 467 |
|
| 468 |
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.'}]}}) |
| 469 |
Details of the HTTP Error. |
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
Status |
| 476 |
------ |
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
Authors |
| 483 |
~~~~~~~ |
| 484 |
|
| 485 |
- Jagadeesh N V (@jagadeeshnv) |
| 486 |
|