Debian Codegraph @

ansible_collections/dellemc/unity/docs/modules/nfs.rst

raw
1 .. _nfs_module:
2
3
4 nfs -- Manage NFS export on Unity storage system
5 ================================================
6
7 .. contents::
8 :local:
9 :depth: 1
10
11
12 Synopsis
13 --------
14
15 Managing NFS export on Unity storage system includes- Create new NFS export, Modify NFS export attributes, Display NFS export details, Delete NFS export.
16
17
18
19 Requirements
20 ------------
21 The below requirements are needed on the host that executes this module.
22
23 - A Dell Unity Storage device version 5.1 or later.
24 - Ansible-core 2.17 or later.
25 - Python 3.11, or 3.12.
26 - Storops Python SDK 1.2.12.
27
28
29
30 Parameters
31 ----------
32
33 nfs_export_name (optional, str, None)
34 Name of the nfs export.
35
36 Mandatory for create operation.
37
38 Specify either *nfs_export_name* or *nfs_export_id* (but not both) for any operation.
39
40
41 nfs_export_id (optional, str, None)
42 ID of the nfs export.
43
44 This is a unique ID generated by Unity storage system.
45
46
47 filesystem_name (optional, str, None)
48 Name of the filesystem for which NFS export will be created.
49
50 Either filesystem or snapshot is required for creation of the NFS.
51
52 If *filesystem_name* is specified, then *nas_server* is required to uniquely identify the filesystem.
53
54 If filesystem parameter is provided, then snapshot cannot be specified.
55
56
57 filesystem_id (optional, str, None)
58 ID of the filesystem.
59
60 This is a unique ID generated by Unity storage system.
61
62
63 snapshot_name (optional, str, None)
64 Name of the snapshot for which NFS export will be created.
65
66 Either filesystem or snapshot is required for creation of the NFS export.
67
68 If snapshot parameter is provided, then filesystem cannot be specified.
69
70
71 snapshot_id (optional, str, None)
72 ID of the snapshot.
73
74 This is a unique ID generated by Unity storage system.
75
76
77 nas_server_name (optional, str, None)
78 Name of the NAS server on which filesystem will be hosted.
79
80
81 nas_server_id (optional, str, None)
82 ID of the NAS server on which filesystem will be hosted.
83
84
85 path (optional, str, None)
86 Local path to export relative to the NAS server root.
87
88 With NFS, each export of a file_system or file_snap must have a unique local path.
89
90 Mandatory while creating NFS export.
91
92
93 description (optional, str, None)
94 Description of the NFS export.
95
96 Optional parameter when creating a NFS export.
97
98 To modify description, pass the new value in *description* field.
99
100 To remove description, pass the empty value in *description* field.
101
102
103 host_state (optional, str, None)
104 Define whether the hosts can access the NFS export.
105
106 Required when adding or removing access of hosts from the export.
107
108
109 anonymous_uid (optional, int, None)
110 Specifies the user ID of the anonymous account.
111
112 If not specified at the time of creation, it will be set to 4294967294.
113
114
115 anonymous_gid (optional, int, None)
116 Specifies the group ID of the anonymous account.
117
118 If not specified at the time of creation, it will be set to 4294967294.
119
120
121 state (True, str, None)
122 State variable to determine whether NFS export will exist or not.
123
124
125 default_access (optional, str, None)
126 Default access level for all hosts that can access the NFS export.
127
128 For hosts that need different access than the default, they can be configured by adding to the list.
129
130 If *default_access* is not mentioned during creation, then NFS export will be created with ``NO_ACCESS``.
131
132
133 min_security (optional, str, None)
134 NFS enforced security type for users accessing a NFS export.
135
136 If not specified at the time of creation, it will be set to ``SYS``.
137
138
139 adv_host_mgmt_enabled (optional, bool, None)
140 If ``false``, allows you to specify hosts without first having to register them.
141
142 Mandatory while adding access hosts.
143
144
145 no_access_hosts (optional, list, None)
146 Hosts with no access to the NFS export.
147
148 List of dictionaries. Each dictionary will have any of the keys from *host_name*, *host_id*, *subnet*, *netgroup*, *domain* and *ip_address*.
149
150 If *adv_host_mgmt_enabled* is ``true`` then the accepted keys are *host_name*, *host_id* and *ip_address*.
151
152 If *adv_host_mgmt_enabled* is ``false`` then the accepted keys are *host_name*, *subnet*, *netgroup*, *domain* and *ip_address*.
153
154
155 host_name (optional, str, None)
156 Name of the host.
157
158
159 host_id (optional, str, None)
160 ID of the host.
161
162
163 ip_address (optional, str, None)
164 IP address of the host.
165
166
167 subnet (optional, str, None)
168 Subnet can be an 'IP address/netmask' or 'IP address/prefix length'.
169
170
171 netgroup (optional, str, None)
172 Netgroup that is defined in NIS or the local netgroup file.
173
174
175 domain (optional, str, None)
176 DNS domain, where all NFS clients in the domain are included in the host list.
177
178
179
180 read_only_hosts (optional, list, None)
181 Hosts with read-only access to the NFS export.
182
183 List of dictionaries. Each dictionary will have any of the keys from *host_name*, *host_id*, *subnet*, *netgroup*, *domain* and *ip_address*.
184
185 If *adv_host_mgmt_enabled* is ``true`` then the accepted keys are *host_name*, *host_id* and *ip_address*.
186
187 If *adv_host_mgmt_enabled* is ``false`` then the accepted keys are *host_name*, *subnet*, *netgroup*, *domain* and *ip_address*.
188
189
190 host_name (optional, str, None)
191 Name of the host.
192
193
194 host_id (optional, str, None)
195 ID of the host.
196
197
198 ip_address (optional, str, None)
199 IP address of the host.
200
201
202 subnet (optional, str, None)
203 Subnet can be an 'IP address/netmask' or 'IP address/prefix length'.
204
205
206 netgroup (optional, str, None)
207 Netgroup that is defined in NIS or the local netgroup file.
208
209
210 domain (optional, str, None)
211 DNS domain, where all NFS clients in the domain are included in the host list.
212
213
214
215 read_only_root_hosts (optional, list, None)
216 Hosts with read-only for root user access to the NFS export.
217
218 List of dictionaries. Each dictionary will have any of the keys from *host_name*, *host_id*, *subnet*, *netgroup*, *domain* and *ip_address*.
219
220 If *adv_host_mgmt_enabled* is ``true`` then the accepted keys are *host_name*, *host_id* and *ip_address*.
221
222 If *adv_host_mgmt_enabled* is ``false`` then the accepted keys are *host_name*, *subnet*, *netgroup*, *domain* and *ip_address*.
223
224
225 host_name (optional, str, None)
226 Name of the host.
227
228
229 host_id (optional, str, None)
230 ID of the host.
231
232
233 ip_address (optional, str, None)
234 IP address of the host.
235
236
237 subnet (optional, str, None)
238 Subnet can be an 'IP address/netmask' or 'IP address/prefix length'.
239
240
241 netgroup (optional, str, None)
242 Netgroup that is defined in NIS or the local netgroup file.
243
244
245 domain (optional, str, None)
246 DNS domain, where all NFS clients in the domain are included in the host list.
247
248
249
250 read_write_hosts (optional, list, None)
251 Hosts with read and write access to the NFS export.
252
253 List of dictionaries. Each dictionary will have any of the keys from *host_name*, *host_id*, *subnet*, *netgroup*, *domain* and *ip_address*.
254
255 If *adv_host_mgmt_enabled* is ``true`` then the accepted keys are *host_name*, *host_id* and *ip_address*.
256
257 If *adv_host_mgmt_enabled* is ``false`` then the accepted keys are *host_name*, *subnet*, *netgroup*, *domain* and *ip_address*.
258
259
260 host_name (optional, str, None)
261 Name of the host.
262
263
264 host_id (optional, str, None)
265 ID of the host.
266
267
268 ip_address (optional, str, None)
269 IP address of the host.
270
271
272 subnet (optional, str, None)
273 Subnet can be an 'IP address/netmask' or 'IP address/prefix length'.
274
275
276 netgroup (optional, str, None)
277 Netgroup that is defined in NIS or the local netgroup file.
278
279
280 domain (optional, str, None)
281 DNS domain, where all NFS clients in the domain are included in the host list.
282
283
284
285 read_write_root_hosts (optional, list, None)
286 Hosts with read and write for root user access to the NFS export.
287
288 List of dictionaries. Each dictionary will have any of the keys from *host_name*, *host_id*, *subnet*, *netgroup*, *domain* and *ip_address*.
289
290 If *adv_host_mgmt_enabled* is ``true`` then the accepted keys are *host_name*, *host_id* and *ip_address*.
291
292 If *adv_host_mgmt_enabled* is ``false`` then the accepted keys are *host_name*, *subnet*, *netgroup*, *domain* and *ip_address*.
293
294
295 host_name (optional, str, None)
296 Name of the host.
297
298
299 host_id (optional, str, None)
300 ID of the host.
301
302
303 ip_address (optional, str, None)
304 IP address of the host.
305
306
307 subnet (optional, str, None)
308 Subnet can be an 'IP address/netmask' or 'IP address/prefix length'.
309
310
311 netgroup (optional, str, None)
312 Netgroup that is defined in NIS or the local netgroup file.
313
314
315 domain (optional, str, None)
316 DNS domain, where all NFS clients in the domain are included in the host list.
317
318
319
320 unispherehost (True, str, None)
321 IP or FQDN of the Unity management server.
322
323
324 username (True, str, None)
325 The username of the Unity management server.
326
327
328 password (True, str, None)
329 The password of the Unity management server.
330
331
332 validate_certs (optional, bool, True)
333 Boolean variable to specify whether or not to validate SSL certificate.
334
335 ``true`` - Indicates that the SSL certificate should be verified.
336
337 ``false`` - Indicates that the SSL certificate should not be verified.
338
339
340 port (optional, int, 443)
341 Port number through which communication happens with Unity management server.
342
343
344
345
346
347 Notes
348 -----
349
350 .. note::
351 - The *check_mode* is not supported.
352 - The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform.
353
354
355
356
357 Examples
358 --------
359
360 .. code-block:: yaml+jinja
361
362
363 - name: Create nfs export from filesystem
364 nfs:
365 unispherehost: "{{unispherehost}}"
366 username: "{{username}}"
367 password: "{{password}}"
368 validate_certs: "{{validate_certs}}"
369 nfs_export_name: "ansible_nfs_from_fs"
370 path: '/'
371 filesystem_id: "fs_377"
372 state: "present"
373
374 - name: Create nfs export from snapshot
375 nfs:
376 unispherehost: "{{unispherehost}}"
377 username: "{{username}}"
378 password: "{{password}}"
379 validate_certs: "{{validate_certs}}"
380 nfs_export_name: "ansible_nfs_from_snap"
381 path: '/'
382 snapshot_name: "ansible_fs_snap"
383 state: "present"
384
385 - name: Modify nfs export
386 nfs:
387 unispherehost: "{{unispherehost}}"
388 username: "{{username}}"
389 password: "{{password}}"
390 validate_certs: "{{validate_certs}}"
391 nfs_export_name: "ansible_nfs_from_fs"
392 nas_server_id: "nas_3"
393 description: ""
394 default_access: "READ_ONLY_ROOT"
395 anonymous_gid: 4294967290
396 anonymous_uid: 4294967290
397 state: "present"
398
399 - name: Add host in nfs export with adv_host_mgmt_enabled as true
400 nfs:
401 unispherehost: "{{unispherehost}}"
402 username: "{{username}}"
403 password: "{{password}}"
404 validate_certs: "{{validate_certs}}"
405 nfs_export_name: "ansible_nfs_from_fs"
406 filesystem_id: "fs_377"
407 adv_host_mgmt_enabled: true
408 no_access_hosts:
409 - host_id: "Host_1"
410 read_only_hosts:
411 - host_id: "Host_2"
412 read_only_root_hosts:
413 - host_name: "host_name1"
414 read_write_hosts:
415 - host_name: "host_name2"
416 read_write_root_hosts:
417 - ip_address: "1.1.1.1"
418 host_state: "present-in-export"
419 state: "present"
420
421 - name: Remove host in nfs export with adv_host_mgmt_enabled as true
422 nfs:
423 unispherehost: "{{unispherehost}}"
424 username: "{{username}}"
425 password: "{{password}}"
426 validate_certs: "{{validate_certs}}"
427 nfs_export_name: "ansible_nfs_from_fs"
428 filesystem_id: "fs_377"
429 adv_host_mgmt_enabled: true
430 no_access_hosts:
431 - host_id: "Host_1"
432 read_only_hosts:
433 - host_id: "Host_2"
434 read_only_root_hosts:
435 - host_name: "host_name1"
436 read_write_hosts:
437 - host_name: "host_name2"
438 read_write_root_hosts:
439 - ip_address: "1.1.1.1"
440 host_state: "absent-in-export"
441 state: "present"
442
443 - name: Add host in nfs export with adv_host_mgmt_enabled as false
444 nfs:
445 unispherehost: "{{unispherehost}}"
446 username: "{{username}}"
447 password: "{{password}}"
448 validate_certs: "{{validate_certs}}"
449 nfs_export_name: "ansible_nfs_from_fs"
450 filesystem_id: "fs_377"
451 adv_host_mgmt_enabled: false
452 no_access_hosts:
453 - domain: "google.com"
454 read_only_hosts:
455 - netgroup: "netgroup_admin"
456 read_only_root_hosts:
457 - host_name: "host5"
458 read_write_hosts:
459 - subnet: "168.159.57.4/255.255.255.0"
460 read_write_root_hosts:
461 - ip_address: "10.255.2.4"
462 host_state: "present-in-export"
463 state: "present"
464
465 - name: Remove host in nfs export with adv_host_mgmt_enabled as false
466 nfs:
467 unispherehost: "{{unispherehost}}"
468 username: "{{username}}"
469 password: "{{password}}"
470 validate_certs: "{{validate_certs}}"
471 nfs_export_name: "ansible_nfs_from_fs"
472 filesystem_id: "fs_377"
473 adv_host_mgmt_enabled: false
474 no_access_hosts:
475 - domain: "google.com"
476 read_only_hosts:
477 - netgroup: "netgroup_admin"
478 read_only_root_hosts:
479 - host_name: "host5"
480 read_write_hosts:
481 - subnet: "168.159.57.4/255.255.255.0"
482 read_write_root_hosts:
483 - ip_address: "10.255.2.4"
484 host_state: "absent-in-export"
485 state: "present"
486
487 - name: Get nfs details
488 nfs:
489 unispherehost: "{{unispherehost}}"
490 username: "{{username}}"
491 password: "{{password}}"
492 validate_certs: "{{validate_certs}}"
493 nfs_export_id: "NFSShare_291"
494 state: "present"
495
496 - name: Delete nfs export by nfs name
497 nfs:
498 unispherehost: "{{unispherehost}}"
499 username: "{{username}}"
500 password: "{{password}}"
501 validate_certs: "{{validate_certs}}"
502 nfs_export_name: "ansible_nfs_name"
503 nas_server_name: "ansible_nas_name"
504 state: "absent"
505
506
507
508 Return Values
509 -------------
510
511 changed (always, bool, false)
512 Whether or not the resource has changed.
513
514
515 nfs_share_details (When nfs export exists., dict, {'anonymous_gid': 4294967294, 'anonymous_uid': 4294967294, 'creation_time': '2022-03-09 15:05:34.720000+00:00', 'default_access': 'NFSShareDefaultAccessEnum.NO_ACCESS', 'description': '', 'export_option': 1, 'export_paths': ['**.***.**.**:/dummy-share-123'], 'filesystem': {'UnityFileSystem': {'id': 'fs_id_1', 'name': 'fs_name_1'}}, 'host_accesses': 'None', 'id': 'NFSShare_14393', 'is_read_only': 'None', 'min_security': 'NFSShareSecurityEnum.SYS', 'modification_time': '2022-04-25 08:12:28.179000+00:00', 'name': 'dummy-share-123', 'nfs_owner_username': 'None', 'no_access_hosts': 'None', 'no_access_hosts_string': 'host1,**.***.*.*', 'path': '/', 'read_only_hosts': 'None', 'read_only_hosts_string': '', 'read_only_root_access_hosts': 'None', 'read_only_root_hosts_string': '', 'read_write_hosts': 'None', 'read_write_hosts_string': '', 'read_write_root_hosts_string': '', 'role': 'NFSShareRoleEnum.PRODUCTION', 'root_access_hosts': 'None', 'snap': 'None', 'type': 'NFSTypeEnum.NFS_SHARE', 'existed': True, 'nas_server': {'UnityNasServer': {'id': 'nas_id_1', 'name': 'dummy_nas_server'}}})
516 Details of the nfs export.
517
518
519 anonymous_uid (, int, )
520 User ID of the anonymous account
521
522
523 anonymous_gid (, int, )
524 Group ID of the anonymous account
525
526
527 default_access (, str, )
528 Default access level for all hosts that can access export
529
530
531 description (, str, )
532 Description about the nfs export
533
534
535 id (, str, )
536 ID of the nfs export
537
538
539 min_security (, str, )
540 NFS enforced security type for users accessing an export
541
542
543 name (, str, )
544 Name of the nfs export
545
546
547 no_access_hosts_string (, str, )
548 Hosts with no access to the nfs export
549
550
551 read_only_hosts_string (, str, )
552 Hosts with read-only access to the nfs export
553
554
555 read_only_root_hosts_string (, str, )
556 Hosts with read-only for root user access to the nfs export
557
558
559 read_write_hosts_string (, str, )
560 Hosts with read and write access to the nfs export
561
562
563 read_write_root_hosts_string (, str, )
564 Hosts with read and write for root user access to export
565
566
567 type (, str, )
568 NFS export type. i.e. filesystem or snapshot
569
570
571 export_paths (, list, )
572 Export paths that can be used to mount and access export
573
574
575 filesystem (, dict, )
576 Details of the filesystem on which nfs export is present
577
578
579 UnityFileSystem (, dict, )
580 filesystem details
581
582
583 id (, str, )
584 ID of the filesystem
585
586
587 name (, str, )
588 Name of the filesystem
589
590
591
592
593 nas_server (, dict, )
594 Details of the nas server
595
596
597 UnityNasServer (, dict, )
598 NAS server details
599
600
601 id (, str, )
602 ID of the nas server
603
604
605 name (, str, )
606 Name of the nas server
607
608
609
610
611
612
613
614
615 Status
616 ------
617
618
619
620
621
622 Authors
623 ~~~~~~~
624
625 - Vivek Soni (@v-soni11) <[email protected]>
626