| 1 |
.. _ome_session_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_session -- Manage OpenManage Enterprise and OpenManage Enterprise modular sessions |
| 5 |
====================================================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module allows you to create and delete sessions on OpenManage Enterprise and OpenManage Enterprise Modular. |
| 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 |
hostname (optional, str, None) |
| 31 |
IP address or hostname of the OpenManage Enterprise. |
| 32 |
|
| 33 |
|
| 34 |
username (optional, str, None) |
| 35 |
Username of the OpenManage Enterprise. If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 36 |
|
| 37 |
\ :emphasis:`username`\ is required when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 38 |
|
| 39 |
|
| 40 |
password (optional, str, None) |
| 41 |
Password of the OpenManage Enterprise. If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 42 |
|
| 43 |
\ :emphasis:`password`\ is required when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 44 |
|
| 45 |
|
| 46 |
port (optional, int, 443) |
| 47 |
Port of the OpenManage Enterprise. |
| 48 |
|
| 49 |
|
| 50 |
validate_certs (optional, bool, True) |
| 51 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 52 |
|
| 53 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 54 |
|
| 55 |
|
| 56 |
ca_path (optional, path, None) |
| 57 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 58 |
|
| 59 |
|
| 60 |
timeout (optional, int, 30) |
| 61 |
The HTTPS socket level timeout in seconds. |
| 62 |
|
| 63 |
|
| 64 |
state (optional, str, present) |
| 65 |
The state of the session in OpenManage Enterprise. |
| 66 |
|
| 67 |
\ :literal:`present`\ creates a session. |
| 68 |
|
| 69 |
\ :literal:`absent`\ deletes a session. |
| 70 |
|
| 71 |
Module will always report changes found to be applied when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 72 |
|
| 73 |
|
| 74 |
x_auth_token (optional, str, None) |
| 75 |
Authentication token. |
| 76 |
|
| 77 |
\ :emphasis:`x\_auth\_token`\ is required when \ :emphasis:`state`\ is \ :literal:`absent`\ . |
| 78 |
|
| 79 |
|
| 80 |
session_id (optional, str, None) |
| 81 |
Session ID of the OpenManage Enterprise. |
| 82 |
|
| 83 |
\ :emphasis:`session\_id`\ is required when \ :emphasis:`state`\ is \ :literal:`absent`\ . |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
Notes |
| 90 |
----- |
| 91 |
|
| 92 |
.. note:: |
| 93 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 94 |
- This module supports IPv4 and IPv6 addresses. |
| 95 |
- This module supports \ :literal:`check\_mode`\ . |
| 96 |
- This module will always report changes found to be applied when \ :emphasis:`state`\ is \ :literal:`present`\ . |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
Examples |
| 102 |
-------- |
| 103 |
|
| 104 |
.. code-block:: yaml+jinja |
| 105 |
|
| 106 |
|
| 107 |
--- |
| 108 |
- name: Create a session |
| 109 |
dellemc.openmanage.ome_session: |
| 110 |
hostname: 198.162.0.1 |
| 111 |
username: username |
| 112 |
password: password |
| 113 |
ca_path: "/path/to/ca_cert.pem" |
| 114 |
state: present |
| 115 |
|
| 116 |
- name: Delete a session |
| 117 |
dellemc.openmanage.ome_session: |
| 118 |
hostname: 198.162.0.1 |
| 119 |
ca_path: "/path/to/ca_cert.pem" |
| 120 |
state: absent |
| 121 |
x_auth_token: aed4aa802b748d2f3b31deec00a6b28a |
| 122 |
session_id: 4b48e9ab-809e-4087-b7c4-201a16e0143d |
| 123 |
|
| 124 |
- name: Create a session and execute other modules |
| 125 |
block: |
| 126 |
- name: Create a session |
| 127 |
dellemc.openmanage.ome_session: |
| 128 |
hostname: 198.162.0.1 |
| 129 |
username: username |
| 130 |
password: password |
| 131 |
ca_path: "/path/to/ca_cert.pem" |
| 132 |
state: present |
| 133 |
register: authData |
| 134 |
|
| 135 |
- name: Call ome_user_info module |
| 136 |
dellemc.openmanage.ome_user_info: |
| 137 |
hostname: 198.162.0.1 |
| 138 |
ca_path: "/path/to/ca_cert.pem" |
| 139 |
x_auth_token: "{{ authData.x_auth_token }}" |
| 140 |
|
| 141 |
- name: Call ome_network_vlan_info module |
| 142 |
dellemc.openmanage.ome_network_vlan_info: |
| 143 |
hostname: 198.162.0.1 |
| 144 |
ca_path: "/path/to/ca_cert.pem" |
| 145 |
x_auth_token: "{{ authData.x_auth_token }}" |
| 146 |
always: |
| 147 |
- name: Destroy a session |
| 148 |
dellemc.openmanage.ome_session: |
| 149 |
hostname: 198.162.0.1 |
| 150 |
ca_path: "/path/to/ca_cert.pem" |
| 151 |
state: absent |
| 152 |
x_auth_token: "{{ authData.x_auth_token }}" |
| 153 |
session_id: "{{ authData.session_data.Id }}" |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
Return Values |
| 158 |
------------- |
| 159 |
|
| 160 |
msg (always, str, The session has been created successfully.) |
| 161 |
Status of the session operation. |
| 162 |
|
| 163 |
|
| 164 |
session_data (For session creation operation, dict, {'Id': 'd5c28d8e-1084-4055-9c01-e1051cfee2dd', 'Description': 'admin', 'Name': 'API', 'UserName': 'admin', 'UserId': 10078, 'Password': None, 'Roles': ['BACKUP_ADMINISTRATOR'], 'IpAddress': '100.198.162.0', 'StartTimeStamp': '2023-07-03 07:22:43.683', 'LastAccessedTimeStamp': '2023-07-03 07:22:43.683', 'DirectoryGroup': []}) |
| 165 |
The session details. |
| 166 |
|
| 167 |
|
| 168 |
x_auth_token (For session creation operation, str, d15f17f01cd627c30173b1582642497d) |
| 169 |
Authentication token. |
| 170 |
|
| 171 |
|
| 172 |
error_info (On HTTP error, dict, {'error': {'@Message.ExtendedInfo': [{'Message': 'Unable to complete the operation because an invalid username and/or password is entered, and therefore authentication failed.', 'MessageArgs': [], '[email protected]': 0, 'MessageId': 'IDRAC.2.7.SYS415', 'RelatedProperties': [], '[email protected]': 0, 'Resolution': 'Enter valid user name and password and retry the operation.', 'Severity': 'Warning'}], 'code': 'Base.1.12.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information'}}) |
| 173 |
Details of the HTTP Error. |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
Status |
| 180 |
------ |
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
Authors |
| 187 |
~~~~~~~ |
| 188 |
|
| 189 |
- Kritika Bhateja (@Kritika-Bhateja-03) |
| 190 |
|