| 1 |
.. _idrac_session_module: |
| 2 |
|
| 3 |
|
| 4 |
idrac_session -- Manage iDRAC sessions |
| 5 |
====================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module allows the creation and deletion of sessions on iDRAC. |
| 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 iDRAC. |
| 32 |
|
| 33 |
|
| 34 |
username (optional, str, None) |
| 35 |
Username of the iDRAC. If the username is not provided, then the environment variable :envvar:`IDRAC\_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 iDRAC. If the password is not provided, then the environment variable :envvar:`IDRAC\_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 iDRAC. |
| 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 an iDRAC. |
| 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 iDRAC. |
| 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 iDRAC. |
| 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.idrac_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.idrac_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: 2 |
| 123 |
|
| 124 |
- name: Create a session and execute other modules |
| 125 |
block: |
| 126 |
- name: Create a session |
| 127 |
dellemc.openmanage.idrac_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 idrac_firmware_info module |
| 136 |
dellemc.openmanage.idrac_firmware_info: |
| 137 |
idrac_ip: 198.162.0.1 |
| 138 |
ca_path: "/path/to/ca_cert.pem" |
| 139 |
x_auth_token: "{{ authData.x_auth_token }}" |
| 140 |
|
| 141 |
- name: Call idrac_user_info module |
| 142 |
dellemc.openmanage.idrac_user_info: |
| 143 |
idrac_ip: 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.idrac_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, {'@Message.ExtendedInfo': [{'Message': 'The resource has been created successfully.', 'MessageArgs': [], 'MessageId': 'Base.1.12.Created', 'RelatedProperties': [], 'Resolution': 'None.', 'Severity': 'OK'}, {'Message': 'A new resource is successfully created.', 'MessageArgs': [], 'MessageId': 'IDRAC.2.9.SYS414', 'RelatedProperties': [], 'Resolution': 'No response action is required.', 'Severity': 'Informational'}], 'ClientOriginIPAddress': '100.96.37.58', 'CreatedTime': '2024-04-05T01:14:01-05:00', 'Description': 'User Session', 'Id': '74', 'Name': 'User Session', 'Password': None, 'SessionType': 'Redfish', 'UserName': 'root'}) |
| 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': [], 'MessageId': 'IDRAC.2.9.SYS415', 'RelatedProperties': [], '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 |
- Rajshekar P(@rajshekarp87) |
| 190 |
- Kritika Bhateja (@Kritika-Bhateja-03) |
| 191 |
- Saksham Nautiyal (@Saksham-Nautiyal) |
| 192 |
|