-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathaaauser.py
404 lines (385 loc) · 14.4 KB
/
aaauser.py
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2023 Cloud Software Group, Inc.
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = r"""
---
module: aaauser
short_description: Configuration for AAA user resource.
description: Configuration for AAA user resource.
version_added: 2.0.0
author:
- Sumanth Lingappa (@sumanth-lingappa)
- Shiva Shankar Vaddepally (@shivashankar-vaddepally)
options:
state:
choices:
- present
- absent
default: present
description:
- The state of the resource being configured by the module on the NetScaler
ADC node.
- When C(present), the resource will be added/updated configured according to
the module's parameters.
- When C(absent), the resource will be deleted from the NetScaler ADC node.
type: str
loggedin:
type: bool
description:
- Show whether the user is logged in or not.
password:
type: str
description:
- Password with which the user logs on. Required for any user account that does
not exist on an external authentication server.
- If you are not using an external authentication server, all user accounts
must have a password. If you are using an external authentication server,
you must provide a password for local user accounts that do not exist on the
authentication server.
username:
type: str
description:
- Name for the user. Must begin with a letter, number, or the underscore character
(_), and must contain only letters, numbers, and the hyphen (-), period (.)
pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
Cannot be changed after the user is added.
- ''
- 'The following requirement applies only to the Citrix ADC CLI:'
- If the name includes one or more spaces, enclose the name in double or
- single quotation marks (for example, "my aaa user" or "my aaa user").
aaauser_auditnslogpolicy_binding:
type: dict
description: Bindings for aaauser_auditnslogpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_auditsyslogpolicy_binding:
type: dict
description: Bindings for aaauser_auditsyslogpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_authorizationpolicy_binding:
type: dict
description: Bindings for aaauser_authorizationpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_intranetip6_binding:
type: dict
description: Bindings for aaauser_intranetip6_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_intranetip_binding:
type: dict
description: Bindings for aaauser_intranetip_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_tmsessionpolicy_binding:
type: dict
description: Bindings for aaauser_tmsessionpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_vpnintranetapplication_binding:
type: dict
description: Bindings for aaauser_vpnintranetapplication_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_vpnsessionpolicy_binding:
type: dict
description: Bindings for aaauser_vpnsessionpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_vpntrafficpolicy_binding:
type: dict
description: Bindings for aaauser_vpntrafficpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_vpnurl_binding:
type: dict
description: Bindings for aaauser_vpnurl_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
aaauser_vpnurlpolicy_binding:
type: dict
description: Bindings for aaauser_vpnurlpolicy_binding resource
suboptions:
mode:
type: str
default: desired
description:
- The mode in which to configure the bindings.
- If mode is set to C(desired), the bindings will be added or removed from
the target NetScaler ADCs as necessary to match the bindings specified
in the state.
- If mode is set to C(bind), the specified bindings will be added to the
resource. The existing bindings in the target ADCs will not be modified.
- If mode is set to C(unbind), the specified bindings will be removed from
the resource. The existing bindings in the target ADCs will not be modified.
choices:
- desired
- bind
- unbind
binding_members:
type: list
elements: dict
description: List of binding members
default: []
extends_documentation_fragment: netscaler.adc.netscaler_adc
"""
EXAMPLES = r"""
---
- name: Sample aaauser playbook
hosts: demo_netscalers
gather_facts: false
tasks:
- name: Configure aaauser
delegate_to: localhost
netscaler.adc.aaauser:
state: present
username: msiuser1
"""
RETURN = r"""
---
changed:
description: Indicates if any change is made by the module
returned: always
type: bool
sample: true
diff:
description: Dictionary of before and after changes
returned: always
type: dict
sample: {'before': {'key1': 'xyz'}, 'after': {'key2': 'pqr'}, 'prepared': 'changes
done'}
diff_list:
description: List of differences between the actual configured object and the configuration
specified in the module
returned: when changed
type: list
sample: ["Attribute `key1` differs. Desired: (<class 'str'>) XYZ. Existing: (<class
'str'>) PQR"]
failed:
description: Indicates if the module failed or not
returned: always
type: bool
sample: false
loglines:
description: list of logged messages by the module
returned: always
type: list
sample: ['message 1', 'message 2']
"""
import os
from ..module_utils.module_executor import ModuleExecutor
RESOURCE_NAME = os.path.basename(__file__).replace(".py", "")
def main():
executor = ModuleExecutor(RESOURCE_NAME)
executor.main()
if __name__ == "__main__":
main()