summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/unity/docs/modules/smbshare.rst
blob: 027fcee253ff83282e02d1fe75e33b7cc7992820 (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
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
.. _smbshare_module:


smbshare -- Manage SMB shares on Unity storage system
=====================================================

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


Synopsis
--------

Managing SMB Shares on Unity storage system includes create, get, modify, and delete the smb shares.



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
----------

  share_name (optional, str, None)
    Name of the SMB share.

    Required during creation of the SMB share.

    For all other operations either *share_name* or *share_id* is required.


  share_id (optional, str, None)
    ID of the SMB share.

    Should not be specified during creation. Id is auto generated.

    For all other operations either *share_name* or *share_id* is required.

    If *share_id* is used then no need to pass nas_server/filesystem/snapshot/path.


  path (optional, str, None)
    Local path to the file system/Snapshot or any existing sub-folder of the file system/Snapshot that is shared over the network.

    Path is relative to the root of the filesystem.

    Required for creation of the SMB share.


  filesystem_id (optional, str, None)
    The ID of the File System.

    Either *filesystem_name* or *filesystem_id* is required for creation of the SMB share for filesystem.

    If *filesystem_name* is specified, then *nas_server_name*/*nas_server_id* is required to uniquely identify the filesystem.

    Options *filesystem_name* and *filesystem_id* are mutually exclusive parameters.


  snapshot_id (optional, str, None)
    The ID of the Filesystem Snapshot.

    Either *snapshot_name* or *snapshot_id* is required for creation of the SMB share for a snapshot.

    If *snapshot_name* is specified, then *nas_server_name*/*nas_server_id* is required to uniquely identify the snapshot.

    Options *snapshot_name* and *snapshot_id* are mutually exclusive parameters.


  nas_server_id (optional, str, None)
    The ID of the NAS Server.

    It is not required if *share_id* is used.


  filesystem_name (optional, str, None)
    The Name of the File System.

    Either *filesystem_name* or *filesystem_id* is required for creation of the SMB share for filesystem.

    If *filesystem_name* is specified, then *nas_server_name*/*nas_server_id* is required to uniquely identify the filesystem.

    Options *filesystem_name* and *filesytem_id* are mutually exclusive parameters.


  snapshot_name (optional, str, None)
    The Name of the Filesystem Snapshot.

    Either *snapshot_name* or *snapshot_id* is required for creation of the SMB share for a snapshot.

    If *snapshot_name* is specified, then *nas_server_name*/*nas_server_id* is required to uniquely identify the snapshot.

    Options *snapshot_name* and *snapshot_id* are mutually exclusive parameters.


  nas_server_name (optional, str, None)
    The Name of the NAS Server.

    It is not required if *share_id* is used.

    Options *nas_server_name* and *nas_server_id* are mutually exclusive parameters.


  description (optional, str, None)
    Description for the SMB share.

    Optional parameter when creating a share.

    To modify, pass the new value in description field.


  is_abe_enabled (optional, bool, None)
    Indicates whether Access-based Enumeration (ABE) for SMB share is enabled.

    During creation, if not mentioned then default is ``false``.


  is_branch_cache_enabled (optional, bool, None)
    Indicates whether Branch Cache optimization for SMB share is enabled.

    During creation, if not mentioned then default is ``false``.


  is_continuous_availability_enabled (optional, bool, None)
    Indicates whether continuous availability for SMB 3.0 is enabled.

    During creation, if not mentioned then default is ``false``.


  is_encryption_enabled (optional, bool, None)
    Indicates whether encryption for SMB 3.0 is enabled at the shared folder level.

    During creation, if not mentioned then default is ``false``.


  offline_availability (optional, str, None)
    Defines valid states of Offline Availability.

    ``MANUAL``- Only specified files will be available offline.

    ``DOCUMENTS``- All files that users open will be available offline.

    ``PROGRAMS``- Program will preferably run from the offline cache even when connected to the network. All files that users open will be available offline.

    ``NONE``- Prevents clients from storing documents and programs in offline cache.


  umask (optional, str, None)
    The default UNIX umask for new files created on the SMB Share.


  state (True, str, None)
    Define whether the SMB share should exist or not.

    Value ``present`` indicates that the share should exist on the system.

    Value ``absent`` indicates that the share should not exist on the system.


  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::
   - When ID/Name of the filesystem/snapshot is passed then *nas_server* is not required. If passed, then filesystem/snapshot should exist for the mentioned *nas_server*, else the task will fail.
   - 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: Create SMB share for a filesystem
      dellemc.unity.smbshare:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        share_name: "sample_smb_share"
        filesystem_name: "sample_fs"
        nas_server_id: "NAS_11"
        path: "/sample_fs"
        description: "Sample SMB share created"
        is_abe_enabled: True
        is_branch_cache_enabled: True
        offline_availability: "DOCUMENTS"
        is_continuous_availability_enabled: True
        is_encryption_enabled: True
        umask: "777"
        state: "present"
    - name: Modify Attributes of SMB share for a filesystem
      dellemc.unity.smbshare:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        share_name: "sample_smb_share"
        nas_server_name: "sample_nas_server"
        description: "Sample SMB share attributes updated"
        is_abe_enabled: False
        is_branch_cache_enabled: False
        offline_availability: "MANUAL"
        is_continuous_availability_enabled: "False"
        is_encryption_enabled: "False"
        umask: "022"
        state: "present"
    - name: Create SMB share for a snapshot
      dellemc.unity.smbshare:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        share_name: "sample_snap_smb_share"
        snapshot_name: "sample_snapshot"
        nas_server_id: "NAS_11"
        path: "/sample_snapshot"
        description: "Sample SMB share created for snapshot"
        is_abe_enabled: True
        is_branch_cache_enabled: True
        is_continuous_availability_enabled: True
        is_encryption_enabled: True
        umask: "777"
        state: "present"
    - name: Modify Attributes of SMB share for a snapshot
      dellemc.unity.smbshare:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        share_name: "sample_snap_smb_share"
        snapshot_name: "sample_snapshot"
        description: "Sample SMB share attributes updated for snapshot"
        is_abe_enabled: False
        is_branch_cache_enabled: False
        offline_availability: "MANUAL"
        is_continuous_availability_enabled: "False"
        is_encryption_enabled: "False"
        umask: "022"
        state: "present"
    - name: Get details of SMB share
      dellemc.unity.smbshare:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        share_id: "{{smb_share_id}}"
        state: "present"
    - name: Delete SMB share
      dellemc.unity.smbshare:
        unispherehost: "{{unispherehost}}"
        username: "{{username}}"
        password: "{{password}}"
        validate_certs: "{{validate_certs}}"
        share_id: "{{smb_share_id}}"
        state: "absent"



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

changed (always, bool, True)
  Whether or not the resource has changed.


smb_share_details (When share exists., dict, {'creation_time': '2022-03-17 11:56:54.867000+00:00', 'description': '', 'existed': True, 'export_paths': ['\\\\multi-prot-pie.extreme1.com\\multi-prot-hui', '\\\\10.230.24.26\\multi-prot-hui'], 'filesystem': {'UnityFileSystem': {'hash': 8748426746492}}, 'filesystem_id': 'fs_140', 'filesystem_name': 'multi-prot-hui', 'hash': 8748426746588, 'id': 'SMBShare_20', 'is_abe_enabled': False, 'is_ace_enabled': False, 'is_branch_cache_enabled': False, 'is_continuous_availability_enabled': False, 'is_dfs_enabled': False, 'is_encryption_enabled': False, 'is_read_only': None, 'modified_time': '2022-03-17 11:56:54.867000+00:00', 'name': 'multi-prot-hui', 'nas_server_id': 'nas_5', 'nas_server_name': 'multi-prot', 'offline_availability': 'CifsShareOfflineAvailabilityEnum.NONE', 'path': '/', 'snap': None, 'type': 'CIFSTypeEnum.CIFS_SHARE', 'umask': '022'})
  The SMB share details.


  id (, str, )
    The ID of the SMB share.


  name (, str, sample_smb_share)
    Name of the SMB share.


  filesystem_id (, str, )
    The ID of the Filesystem.


  filesystem_name (, str, )
    The Name of the filesystem


  snapshot_id (, str, )
    The ID of the Snapshot.


  snapshot_name (, str, )
    The Name of the Snapshot.


  nas_server_id (, str, )
    The ID of the nas_server.


  nas_server_name (, str, )
    The Name of the nas_server.


  description (, str, This share is created for demo purpose only.)
    Additional information about the share.


  is_abe_enabled (, bool, False)
    Whether Access Based enumeration is enforced or not.


  is_branch_cache_enabled (, bool, False)
    Whether branch cache is enabled or not.


  is_continuous_availability_enabled (, bool, False)
    Whether the share will be available continuously or not.


  is_encryption_enabled (, bool, False)
    Whether encryption is enabled or not.


  umask (, str, )
    Unix mask for the SMB share.






Status
------





Authors
~~~~~~~

- P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>