dellemc.unity.dellemc_unity_smbshare (1.2.1) — module

Manage SMB shares on Unity storage system

| "added in version" 1.1.0 of dellemc.unity"

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

preview | supported by community

Install collection

Install with ansible-galaxy collection install dellemc.unity:==1.2.1


Add to requirements.yml

  collections:
    - name: dellemc.unity
      version: 1.2.1

Description

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


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create SMB share for a filesystem
  dellemc.unity.dellemc_unity_smbshare:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Attributes of SMB share for a filesystem
  dellemc.unity.dellemc_unity_smbshare:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create SMB share for a snapshot
  dellemc.unity.dellemc_unity_smbshare:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Attributes of SMB share for a snapshot
  dellemc.unity.dellemc_unity_smbshare:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of SMB share
  dellemc.unity.dellemc_unity_smbshare:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    share_id: "{{smb_share_id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete SMB share
  dellemc.unity.dellemc_unity_smbshare:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    verifycert: "{{verifycert}}"
    share_id: "{{smb_share_id}}"
    state: "absent"

Inputs

    
path:
    description:
    - 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.
    type: str

port:
    default: 443
    description:
    - Port number through which communication happens with Unity management server.
    required: false
    type: int

state:
    choices:
    - absent
    - present
    description:
    - Define whether the SMB share should exist or not.
    - present  indicates that the share should exist on the system.
    - absent  indicates that the share should not exist on the system.
    required: true
    type: str

umask:
    description:
    - The default UNIX umask for new files created on the SMB Share.
    type: str

password:
    description:
    - The password of the Unity management server.
    required: true
    type: str

share_id:
    description:
    - 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.
    type: str

username:
    description:
    - The username of the Unity management server.
    required: true
    type: str

share_name:
    description:
    - Name of the SMB share.
    - Required during creation of the SMB share.
    - For all other operations either share_name or share_id is required.
    type: str

verifycert:
    choices:
    - true
    - false
    default: true
    description:
    - 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.
    required: false
    type: bool

description:
    description:
    - Description for the SMB share.
    - Optional parameter when creating a share.
    - To modify, pass the new value in description field.
    type: str

snapshot_id:
    description:
    - 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.
    - snapshot_name and snapshot_id are mutually exclusive parameters.
    type: str

filesystem_id:
    description:
    - 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.
    - filesystem_name and filesystem_id are mutually exclusive parameters.
    type: str

nas_server_id:
    description:
    - The ID of the NAS Server.
    - It is not required if share_id is used.
    type: str

snapshot_name:
    description:
    - 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.
    - snapshot_name and snapshot_id are mutually exclusive parameters.
    type: str

unispherehost:
    description:
    - IP or FQDN of the Unity management server.
    required: true
    type: str

is_abe_enabled:
    description:
    - Indicates whether Access-based Enumeration (ABE) for SMB share is enabled.
    - During creation, if not mentioned then default is False.
    type: bool

filesystem_name:
    description:
    - 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.
    - filesystem_name and filesytem_id are mutually exclusive parameters.
    type: str

nas_server_name:
    description:
    - The Name of the NAS Server.
    - It is not required if share_id is used.
    - nas_server_name and nas_server_id are mutually exclusive parameters.
    type: str

offline_availability:
    choices:
    - MANUAL
    - DOCUMENTS
    - PROGRAMS
    - NONE
    description:
    - 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.
    type: str

is_encryption_enabled:
    description:
    - Indicates whether encryption for SMB 3.0 is enabled at the shared folder level.
    - During creation, if not mentioned then default is False.
    type: bool

is_branch_cache_enabled:
    description:
    - Indicates whether Branch Cache optimization for SMB share is enabled.
    - During creation, if not mentioned then default is False.
    type: bool

is_continuous_availability_enabled:
    description:
    - Indicates whether continuous availability for SMB 3.0 is enabled.
    - During creation, if not mentioned then default is False.
    type: bool

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: true
  type: bool
smb_share_details:
  contains:
    description:
      description: Additional information about the share.
      sample: This share is created for demo purpose only.
      type: str
    filesystem_id:
      description: The ID of the Filesystem.
      type: str
    filesystem_name:
      description: The Name of the filesystem
      type: str
    id:
      description: The ID of the SMB share.
      type: str
    is_abe_enabled:
      description: Whether Access Based enumeration is enforced or not
      sample: false
      type: bool
    is_branch_cache_enabled:
      description: Whether branch cache is enabled or not.
      sample: false
      type: bool
    is_continuous_availability_enabled:
      description: Whether the share will be available continuously or not
      sample: false
      type: bool
    is_encryption_enabled:
      description: Whether encryption is enabled or not.
      sample: false
      type: bool
    name:
      description: Name of the SMB share.
      sample: sample_smb_share
      type: str
    nas_server_id:
      description: The ID of the nas_server.
      type: str
    nas_server_name:
      description: The Name of the nas_server.
      type: str
    snapshot_id:
      description: The ID of the Snapshot.
      type: str
    snapshot_name:
      description: The Name of the Snapshot.
      type: str
    umask:
      description: Unix mask for the SMB share
      type: str
  description: The SMB share details.
  returned: When share exists.
  type: complex