Debian Codegraph @

ansible_collections/dellemc/openmanage/docs/modules/ome_user.rst

raw
1 .. _ome_user_module:
2
3
4 ome_user -- Create, modify or delete a user on OpenManage Enterprise
5 ====================================================================
6
7 .. contents::
8 :local:
9 :depth: 1
10
11
12 Synopsis
13 --------
14
15 This module creates, modifies or deletes a user 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`\ creates a user in case the \ :emphasis:`UserName`\ provided inside \ :emphasis:`attributes`\ does not exist.
32
33 \ :literal:`present`\ modifies a user in case the \ :emphasis:`UserName`\ provided inside \ :emphasis:`attributes`\ exists.
34
35 \ :literal:`absent`\ deletes an existing user.
36
37
38 user_id (optional, int, None)
39 Unique ID of the user to be deleted.
40
41 Either \ :emphasis:`user\_id`\ or \ :emphasis:`name`\ is mandatory for \ :literal:`absent`\ operation.
42
43
44 name (optional, str, None)
45 Unique Name of the user to be deleted.
46
47 Either \ :emphasis:`user\_id`\ or \ :emphasis:`name`\ is mandatory for \ :literal:`absent`\ operation.
48
49
50 attributes (optional, dict, {})
51 Payload data for the user operations. It can take the following attributes for \ :literal:`present`\ .
52
53 UserTypeId, DirectoryServiceId, Description, Name, Password, UserName, RoleId, Locked, Enabled.
54
55 OME will throw error if required parameter is not provided for operation.
56
57 Refer OpenManage Enterprise API Reference Guide for more details.
58
59
60 hostname (True, str, None)
61 OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname.
62
63
64 username (False, str, None)
65 OpenManage Enterprise or OpenManage Enterprise Modular username.
66
67 If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used.
68
69 Example: export OME\_USERNAME=username
70
71
72 password (False, str, None)
73 OpenManage Enterprise or OpenManage Enterprise Modular password.
74
75 If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used.
76
77 Example: export OME\_PASSWORD=password
78
79
80 x_auth_token (False, str, None)
81 Authentication token.
82
83 If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used.
84
85 Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token
86
87
88 port (optional, int, 443)
89 OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port.
90
91
92 validate_certs (optional, bool, True)
93 If \ :literal:`false`\ , the SSL certificates will not be validated.
94
95 Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used.
96
97 Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default.
98
99
100 ca_path (optional, path, None)
101 The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
102
103
104 timeout (optional, int, 30)
105 The socket level timeout in seconds.
106
107
108
109
110
111 Notes
112 -----
113
114 .. note::
115 - Run this module from a system that has direct access to Dell OpenManage Enterprise.
116 - This module does not support \ :literal:`check\_mode`\ .
117
118
119
120
121 Examples
122 --------
123
124 .. code-block:: yaml+jinja
125
126
127 ---
128 - name: Create user with required parameters
129 dellemc.openmanage.ome_user:
130 hostname: "192.168.0.1"
131 username: "username"
132 password: "password"
133 ca_path: "/path/to/ca_cert.pem"
134 attributes:
135 UserName: "user1"
136 Password: "UserPassword"
137 RoleId: "10"
138 Enabled: true
139
140 - name: Create user with all parameters
141 dellemc.openmanage.ome_user:
142 hostname: "192.168.0.1"
143 username: "username"
144 password: "password"
145 ca_path: "/path/to/ca_cert.pem"
146 attributes:
147 UserName: "user2"
148 Description: "user2 description"
149 Password: "UserPassword"
150 RoleId: "10"
151 Enabled: true
152 DirectoryServiceId: 0
153 UserTypeId: 1
154 Locked: false
155 Name: "user2"
156
157 - name: Modify existing user
158 dellemc.openmanage.ome_user:
159 hostname: "192.168.0.1"
160 username: "username"
161 password: "password"
162 ca_path: "/path/to/ca_cert.pem"
163 state: "present"
164 attributes:
165 UserName: "user3"
166 RoleId: "10"
167 Enabled: true
168 Description: "Modify user Description"
169
170 - name: Delete existing user using id
171 dellemc.openmanage.ome_user:
172 hostname: "192.168.0.1"
173 username: "username"
174 password: "password"
175 ca_path: "/path/to/ca_cert.pem"
176 state: "absent"
177 user_id: 1234
178
179 - name: Delete existing user using name
180 dellemc.openmanage.ome_user:
181 hostname: "192.168.0.1"
182 username: "username"
183 password: "password"
184 ca_path: "/path/to/ca_cert.pem"
185 state: "absent"
186 name: "name"
187
188
189
190 Return Values
191 -------------
192
193 msg (always, str, Successfully created a User)
194 Overall status of the user operation.
195
196
197 user_status (When I(state) is C(present)., dict, {'Description': 'Test user creation', 'DirectoryServiceId': 0, 'Enabled': True, 'Id': '61546', 'IsBuiltin': False, 'Locked': False, 'Name': 'test', 'Password': None, 'PlainTextPassword': None, 'RoleId': '10', 'UserName': 'test', 'UserTypeId': 1})
198 Details of the user operation, when \ :emphasis:`state`\ is \ :literal:`present`\ .
199
200
201
202
203
204 Status
205 ------
206
207
208
209
210
211 Authors
212 ~~~~~~~
213
214 - Sajna Shetty(@Sajna-Shetty)
215