dellemc.unity.smbshare module – Manage SMB shares on Unity storage system
Note
This module is part of the dellemc.unity collection (version 2.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install dellemc.unity
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: dellemc.unity.smbshare
.
New in dellemc.unity 1.1.0
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.14 or later.
Python 3.9, 3.10 or 3.11.
Storops Python SDK 1.2.11.
Parameters
Parameter |
Comments |
---|---|
Description for the SMB share. Optional parameter when creating a share. To modify, pass the new value in description field. |
|
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. |
|
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. |
|
Indicates whether Access-based Enumeration (ABE) for SMB share is enabled. During creation, if not mentioned then default is Choices:
|
|
Indicates whether Branch Cache optimization for SMB share is enabled. During creation, if not mentioned then default is Choices:
|
|
Indicates whether continuous availability for SMB 3.0 is enabled. During creation, if not mentioned then default is Choices:
|
|
Indicates whether encryption for SMB 3.0 is enabled at the shared folder level. During creation, if not mentioned then default is Choices:
|
|
The ID of the NAS Server. It is not required if share_id is used. |
|
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. |
|
Defines valid states of Offline Availability.
Choices:
|
|
The password of the Unity management server. |
|
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. |
|
Port number through which communication happens with Unity management server. Default: |
|
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. |
|
Name of the SMB share. Required during creation of the SMB share. For all other operations either share_name or share_id is required. |
|
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. |
|
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. |
|
Define whether the SMB share should exist or not. Value Value Choices:
|
|
The default UNIX umask for new files created on the SMB Share. |
|
IP or FQDN of the Unity management server. |
|
The username of the Unity management server. |
|
Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
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
- 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
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Whether or not the resource has changed. Returned: always Sample: |
|
The SMB share details. Returned: When share exists. Sample: |
|
Additional information about the share. Returned: success Sample: |
|
The ID of the Filesystem. Returned: success |
|
The Name of the filesystem Returned: success |
|
The ID of the SMB share. Returned: success |
|
Whether Access Based enumeration is enforced or not. Returned: success Sample: |
|
Whether branch cache is enabled or not. Returned: success Sample: |
|
Whether the share will be available continuously or not. Returned: success Sample: |
|
Whether encryption is enabled or not. Returned: success Sample: |
|
Name of the SMB share. Returned: success Sample: |
|
The ID of the nas_server. Returned: success |
|
The Name of the nas_server. Returned: success |
|
The ID of the Snapshot. Returned: success |
|
The Name of the Snapshot. Returned: success |
|
Unix mask for the SMB share. Returned: success |
Authors
P Srinivas Rao (@srinivas-rao5)