summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/openmanage/docs/modules/ome_session.rst
blob: d18023729e1edcba57d3c34b2158993d170349d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
.. _ome_session_module:


ome_session -- Manage OpenManage Enterprise and OpenManage Enterprise modular sessions
======================================================================================

.. contents::
   :local:
   :depth: 1


Synopsis
--------

This module allows you  to create and delete sessions on OpenManage Enterprise and OpenManage Enterprise Modular.



Requirements
------------
The below requirements are needed on the host that executes this module.

- python \>= 3.9.6



Parameters
----------

  hostname (optional, str, None)
    IP address or hostname of the OpenManage Enterprise.


  username (optional, str, None)
    Username of the OpenManage Enterprise. If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\  is used.

    \ :emphasis:`username`\  is required when \ :emphasis:`state`\  is \ :literal:`present`\ .


  password (optional, str, None)
    Password of the OpenManage Enterprise. If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\  is used.

    \ :emphasis:`password`\  is required when \ :emphasis:`state`\  is \ :literal:`present`\ .


  port (optional, int, 443)
    Port of the OpenManage Enterprise.


  validate_certs (optional, bool, True)
    If \ :literal:`false`\ , the SSL certificates will not be validated.

    Configure \ :literal:`false`\  only on personally controlled sites where self-signed certificates are used.


  ca_path (optional, path, None)
    The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.


  timeout (optional, int, 30)
    The HTTPS socket level timeout in seconds.


  state (optional, str, present)
    The state of the session in OpenManage Enterprise.

    \ :literal:`present`\  creates a session.

    \ :literal:`absent`\  deletes a session.

    Module will always report changes found to be applied when \ :emphasis:`state`\  is \ :literal:`present`\ .


  x_auth_token (optional, str, None)
    Authentication token.

    \ :emphasis:`x\_auth\_token`\  is required when \ :emphasis:`state`\  is \ :literal:`absent`\ .


  session_id (optional, str, None)
    Session ID of the OpenManage Enterprise.

    \ :emphasis:`session\_id`\  is required when \ :emphasis:`state`\  is \ :literal:`absent`\ .





Notes
-----

.. note::
   - Run this module from a system that has direct access to Dell OpenManage Enterprise.
   - This module supports IPv4 and IPv6 addresses.
   - This module supports \ :literal:`check\_mode`\ .
   - This module will always report changes found to be applied when \ :emphasis:`state`\  is \ :literal:`present`\ .




Examples
--------

.. code-block:: yaml+jinja

    
    ---
    - name: Create a session
      dellemc.openmanage.ome_session:
        hostname: 198.162.0.1
        username: username
        password: password
        ca_path: "/path/to/ca_cert.pem"
        state: present

    - name: Delete a session
      dellemc.openmanage.ome_session:
        hostname: 198.162.0.1
        ca_path: "/path/to/ca_cert.pem"
        state: absent
        x_auth_token: aed4aa802b748d2f3b31deec00a6b28a
        session_id: 4b48e9ab-809e-4087-b7c4-201a16e0143d

    - name: Create a session and execute other modules
      block:
        - name: Create a session
          dellemc.openmanage.ome_session:
            hostname: 198.162.0.1
            username: username
            password: password
            ca_path: "/path/to/ca_cert.pem"
            state: present
            register: authData

        - name: Call ome_user_info module
          dellemc.openmanage.ome_user_info:
            hostname: 198.162.0.1
            ca_path: "/path/to/ca_cert.pem"
            x_auth_token: "{{ authData.x_auth_token }}"

        - name: Call ome_network_vlan_info module
          dellemc.openmanage.ome_network_vlan_info:
            hostname: 198.162.0.1
            ca_path: "/path/to/ca_cert.pem"
            x_auth_token: "{{ authData.x_auth_token }}"
      always:
        - name: Destroy a session
          dellemc.openmanage.ome_session:
            hostname: 198.162.0.1
            ca_path: "/path/to/ca_cert.pem"
            state: absent
            x_auth_token: "{{ authData.x_auth_token }}"
            session_id: "{{ authData.session_data.Id }}"



Return Values
-------------

msg (always, str, The session has been created successfully.)
  Status of the session operation.


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': []})
  The session details.


x_auth_token (For session creation operation, str, d15f17f01cd627c30173b1582642497d)
  Authentication token.


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': [], 'MessageArgs@odata.count': 0, 'MessageId': 'IDRAC.2.7.SYS415', 'RelatedProperties': [], 'RelatedProperties@odata.count': 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'}})
  Details of the HTTP Error.





Status
------





Authors
~~~~~~~

- Kritika Bhateja (@Kritika-Bhateja-03)