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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
|
.. _nasserver_module:
nasserver -- Manage NAS servers on Unity storage system
=======================================================
.. contents::
:local:
:depth: 1
Synopsis
--------
Managing NAS servers on Unity storage system includes get, modification to the NAS servers.
Requirements
------------
The below requirements are needed on the host that executes this module.
- A Dell Unity Storage device version 5.1 or later.
- Ansible-core 2.13 or later.
- Python 3.9, 3.10 or 3.11.
- Storops Python SDK 1.2.11.
Parameters
----------
nas_server_id (optional, str, None)
The ID of the NAS server.
Either *nas_server_name* or *nas_server_id* is required to perform the task.
The parameters *nas_server_name* and *nas_server_id* are mutually exclusive.
nas_server_name (optional, str, None)
The Name of the NAS server.
Either *nas_server_name* or *nas_server_id* is required to perform the task.
The parameters *nas_server_name* and *nas_server_id* are mutually exclusive.
nas_server_new_name (optional, str, None)
The new name of the NAS server.
It can be mentioned during modification of the NAS server.
is_replication_destination (optional, bool, None)
It specifies whether the NAS server is a replication destination.
It can be mentioned during modification of the NAS server.
is_backup_only (optional, bool, None)
It specifies whether the NAS server is used as backup only.
It can be mentioned during modification of the NAS server.
is_multiprotocol_enabled (optional, bool, None)
This parameter indicates whether multiprotocol sharing mode is enabled.
It can be mentioned during modification of the NAS server.
allow_unmapped_user (optional, bool, None)
This flag is used to mandatorily disable access in case of any user mapping failure.
If ``true``, then enable access in case of any user mapping failure.
If ``false``, then disable access in case of any user mapping failure.
It can be mentioned during modification of the NAS server.
default_windows_user (optional, str, None)
Default windows user name used for granting access in the case of Unix to Windows user mapping failure.
It can be mentioned during modification of the NAS server.
default_unix_user (optional, str, None)
Default Unix user name used for granting access in the case of Windows to Unix user mapping failure.
It can be mentioned during modification of the NAS server.
enable_windows_to_unix_username_mapping (optional, bool, None)
This parameter indicates whether a Unix to/from Windows user name mapping is enabled.
It can be mentioned during modification of the NAS server.
is_packet_reflect_enabled (optional, bool, None)
If the packet has to be reflected, then this parameter has to be set to ``true``.
It can be mentioned during modification of the NAS server.
current_unix_directory_service (optional, str, None)
This is the directory service used for querying identity information for UNIX (such as UIDs, GIDs, net groups).
It can be mentioned during modification of the NAS server.
replication_params (optional, dict, None)
Settings required for enabling replication.
destination_nas_server_name (optional, str, None)
Name of the destination nas server.
Default value will be source nas server name prefixed by 'DR_'.
replication_mode (optional, str, None)
The replication mode.
This is mandatory to enable replication.
rpo (optional, int, None)
Maximum time to wait before the system syncs the source and destination LUNs.
The *rpo* option should be specified if the *replication_mode* is ``asynchronous``.
The value should be in range of ``5`` to ``1440``.
replication_type (optional, str, None)
Type of replication.
remote_system (optional, dict, None)
Details of remote system to which the replication is being configured.
The *remote_system* option should be specified if the *replication_type* is ``remote``.
remote_system_host (True, str, None)
IP or FQDN for remote Unity unisphere Host.
remote_system_username (True, str, None)
User name of remote Unity unisphere Host.
remote_system_password (True, str, None)
Password of remote Unity unisphere Host.
remote_system_verifycert (optional, bool, True)
Boolean variable to specify whether or not to validate SSL certificate of remote Unity unisphere Host.
``true`` - Indicates that the SSL certificate should be verified.
``false`` - Indicates that the SSL certificate should not be verified.
remote_system_port (optional, int, 443)
Port at which remote Unity unisphere is hosted.
destination_pool_name (optional, str, None)
Name of pool to allocate destination Luns.
Mutually exclusive with *destination_pool_id*.
destination_pool_id (optional, str, None)
Id of pool to allocate destination Luns.
Mutually exclusive with *destination_pool_name*.
destination_sp (optional, str, None)
Storage process of destination nas server
is_backup (optional, bool, None)
Indicates if the destination nas server is backup.
replication_name (optional, str, None)
User defined name for replication session.
new_replication_name (optional, str, None)
Replication name to rename the session to.
replication_state (optional, str, None)
State of the replication.
replication_reuse_resource (optional, bool, None)
This parameter indicates if existing NAS Server is to be used for replication.
state (True, str, None)
Define the state of NAS server on the array.
The value present indicates that NAS server should exist on the system after the task is executed.
In this release deletion of NAS server is not supported. Hence, if state is set to ``absent`` for any existing NAS server then error will be thrown.
For any non-existing NAS server, if state is set to ``absent`` then it will return None.
unispherehost (True, str, None)
IP or FQDN of the Unity management server.
username (True, str, None)
The username of the Unity management server.
password (True, str, None)
The password of the Unity management server.
validate_certs (optional, bool, True)
Boolean variable to specify whether or not to validate SSL certificate.
``true`` - Indicates that the SSL certificate should be verified.
``false`` - Indicates that the SSL certificate should not be verified.
port (optional, int, 443)
Port number through which communication happens with Unity management server.
Notes
-----
.. note::
- The *check_mode* is not supported.
- The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform.
Examples
--------
.. code-block:: yaml+jinja
- name: Get Details of NAS Server
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "{{nas_server_name}}"
state: "present"
- name: Modify Details of NAS Server
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "{{nas_server_name}}"
nas_server_new_name: "updated_sample_nas_server"
is_replication_destination: False
is_backup_only: False
is_multiprotocol_enabled: True
allow_unmapped_user: True
default_unix_user: "default_unix_sample_user"
default_windows_user: "default_windows_sample_user"
enable_windows_to_unix_username_mapping: True
current_unix_directory_service: "LDAP"
is_packet_reflect_enabled: True
state: "present"
- name: Enable replication for NAS Server on Local System
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_id: "nas_10"
replication_reuse_resource: False
replication_params:
replication_name: "test_replication"
destination_nas_server_name: "destination_nas"
replication_mode: "asynchronous"
rpo: 60
replication_type: "local"
destination_pool_name: "Pool_Ansible_Neo_DND"
destination_sp: "SPA"
is_backup: True
replication_state: "enable"
state: "present"
- name: Enable replication for NAS Server on Remote System
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "dummy_nas"
replication_reuse_resource: False
replication_params:
replication_name: "test_replication"
destination_nas_server_name: "destination_nas"
replication_mode: "asynchronous"
rpo: 60
replication_type: "remote"
remote_system:
remote_system_host: '10.10.10.10'
remote_system_verifycert: False
remote_system_username: 'test1'
remote_system_password: 'test1!'
destination_pool_name: "fastVP_pool"
destination_sp: "SPA"
is_backup: True
replication_state: "enable"
state: "present"
- name: Enable replication for NAS Server on Remote System in existing NAS Server
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "dummy_nas"
replication_reuse_resource: True
replication_params:
destination_nas_server_name: "destination_nas"
replication_mode: "asynchronous"
rpo: 60
replication_type: "remote"
replication_name: "test_replication"
remote_system:
remote_system_host: '10.10.10.10'
remote_system_verifycert: False
remote_system_username: 'test1'
remote_system_password: 'test1!'
destination_pool_name: "fastVP_pool"
replication_state: "enable"
state: "present"
- name: Modify replication on the nasserver
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "dummy_nas"
replication_params:
replication_name: "test_repl"
new_replication_name: "test_repl_updated"
replication_mode: "asynchronous"
rpo: 50
replication_state: "enable"
state: "present"
- name: Disable replication on the nasserver
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "dummy_nas"
replication_state: "disable"
state: "present"
- name: Disable replication by specifying replication_name on the nasserver
dellemc.unity.nasserver:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
nas_server_name: "dummy_nas"
replication_params:
replication_name: "test_replication"
replication_state: "disable"
state: "present"
Return Values
-------------
changed (always, bool, True)
Whether or not the resource has changed.
nas_server_details (When NAS server exists., dict, {'allow_unmapped_user': None, 'cifs_server': {'UnityCifsServerList': [{'UnityCifsServer': {'hash': 8761756885270, 'id': 'cifs_34'}}]}, 'current_sp': {'UnityStorageProcessor': {'hash': 8761756885273, 'id': 'spb'}}, 'current_unix_directory_service': 'NasServerUnixDirectoryServiceEnum.NIS', 'default_unix_user': None, 'default_windows_user': None, 'existed': True, 'file_dns_server': {'UnityFileDnsServer': {'hash': 8761756885441, 'id': 'dns_12'}}, 'file_interface': {'UnityFileInterfaceList': [{'UnityFileInterface': {'hash': 8761756889908, 'id': 'if_37'}}]}, 'filesystems': None, 'hash': 8761757005084, 'health': {'UnityHealth': {'hash': 8761756867588}}, 'home_sp': {'UnityStorageProcessor': {'hash': 8761756867618, 'id': 'spb'}}, 'id': 'nas_10', 'is_backup_only': False, 'is_multi_protocol_enabled': False, 'is_packet_reflect_enabled': False, 'is_replication_destination': False, 'is_replication_enabled': True, 'is_windows_to_unix_username_mapping_enabled': None, 'name': 'dummy_nas', 'pool': {'UnityPool': {'hash': 8761756885360, 'id': 'pool_7'}}, 'preferred_interface_settings': {'UnityPreferredInterfaceSettings': {'hash': 8761756885438, 'id': 'preferred_if_10'}}, 'replication_type': 'ReplicationTypeEnum.REMOTE', 'size_allocated': 3489660928, 'tenant': None, 'virus_checker': {'UnityVirusChecker': {'hash': 8761756885426, 'id': 'cava_10'}}})
The NAS server details.
name (, str, )
Name of the NAS server.
id (, str, )
ID of the NAS server.
allow_unmapped_user (, bool, )
Enable/disable access status in case of any user mapping failure.
current_unix_directory_service (, str, )
Directory service used for querying identity information for UNIX (such as UIDs, GIDs, net groups).
default_unix_user (, str, )
Default Unix user name used for granting access in the case of Windows to Unix user mapping failure.
default_windows_user (, str, )
Default windows user name used for granting access in the case of Unix to Windows user mapping failure.
is_backup_only (, bool, )
Whether the NAS server is used as backup only.
is_multi_protocol_enabled (, bool, )
Indicates whether multiprotocol sharing mode is enabled.
is_packet_reflect_enabled (, bool, )
If the packet reflect has to be enabled.
is_replication_destination (, bool, )
If the NAS server is a replication destination then True.
is_windows_to_unix_username_mapping_enabled (, bool, )
Indicates whether a Unix to/from Windows user name mapping is enabled.
Status
------
Authors
~~~~~~~
- P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>
|