dellemc / dellemc.powerstore / 3.2.0 / module / smbshare Manage SMB shares on a PowerStore storage system | "added in version" 1.1.0 of dellemc.powerstore" Authors: P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>dellemc.powerstore.smbshare (3.2.0) — module
Install with ansible-galaxy collection install dellemc.powerstore:==3.2.0
collections: - name: dellemc.powerstore version: 3.2.0
Managing SMB Shares on PowerStore storage system includes create, get, modify, and delete the SMB shares.
- name: Create SMB share for a filesystem dellemc.powerstore.smbshare: array_ip: "{{array_ip}}" validate_certs: "{{validate_certs}}" user: "{{user}}" password: "{{password}}" share_name: "sample_smb_share" filesystem: "sample_fs" nas_server: "{{nas_server_id}}" path: "{{path}}" 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 state: "present"
- name: Modify Attributes of SMB share for a filesystem dellemc.powerstore.smbshare: array_ip: "{{array_ip}}" validate_certs: "{{validate_certs}}" user: "{{user}}" password: "{{password}}" share_name: "sample_smb_share" nas_server: "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.powerstore.smbshare: array_ip: "{{array_ip}}" validate_certs: "{{validate_certs}}" user: "{{user}}" password: "{{password}}" share_name: "sample_snap_smb_share" snapshot: "sample_snapshot" nas_server: "{{nas_server_id}}" path: "{{path}}" description: "Sample SMB share created for snapshot" is_abe_enabled: true is_branch_cache_enabled: true is_continuous_availability_enabled: true state: "present"
- name: Modify Attributes of SMB share for a snapshot dellemc.powerstore.smbshare: array_ip: "{{array_ip}}" validate_certs: "{{validate_certs}}" user: "{{user}}" password: "{{password}}" share_name: "sample_snap_smb_share" nas_server: "sample_nas_server" 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 umask: "022" state: "present"
- name: Get details of SMB share dellemc.powerstore.smbshare: array_ip: "{{array_ip}}" validate_certs: "{{validate_certs}}" user: "{{user}}" password: "{{password}}" share_id: "{{smb_share_id}}" state: "present"
- name: Delete SMB share dellemc.powerstore.smbshare: array_ip: "{{array_ip}}" validate_certs: "{{validate_certs}}" user: "{{user}}" password: "{{password}}" share_id: "{{smb_share_id}}" state: "absent"
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 base of the NAS server and must start with the name of the filesystem. - Required for creation of the SMB share. type: str port: description: - Port number for the PowerStore array. - If not passed, it will take 443 as default. type: int user: description: - The username of the PowerStore host. required: true type: str state: choices: - absent - present description: - Define whether the SMB share should exist or not. - Value C(present) indicates that the share should exist on the system. - Value C(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. - During creation, if not mentioned, then the default is 022. - For all other operations, the default is None. type: str timeout: default: 120 description: - Time after which the connection will get terminated. - It is to be mentioned in seconds. type: int array_ip: description: - IP or FQDN of the PowerStore management system. required: true type: str password: description: - The password of the PowerStore host. 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 I(share_name) or I(share_id) is required. - If I(share_id) is used then no need to pass I(nas_server)/I(filesystem)/I(snapshot)/ I(path). type: str snapshot: description: - The ID/Name of the Snapshot. - Either filesystem or snapshot is required for creation of the SMB share. - If snapshot name is specified, then I(nas_server) is required to uniquely identify the snapshot. - If snapshot parameter is provided, then filesystem cannot be specified. - SMB share can be created only if access type of snapshot is "protocol". type: str filesystem: description: - The ID/Name of the File System. - Either filesystem or snapshot is required for creation of the SMB share. - If filesystem name is specified, then I(nas_server) is required to uniquely identify the filesystem. - If filesystem parameter is provided, then snapshot cannot be specified. type: str nas_server: description: - The ID/Name of the NAS Server. - It is not required if I(share_id) is used. type: str share_name: description: - Name of the SMB share. - Required during creation of the SMB share. - For all other operations either I(share_name) or I(share_id) is required. type: str description: description: - Description for the SMB share. - Optional parameter when creating a share. - To modify, pass the new value in description field. type: str is_abe_enabled: description: - Indicates whether Access-based Enumeration (ABE) for SMB share is enabled. - During creation, if not mentioned, then the default is C(false). type: bool validate_certs: aliases: - verifycert default: true description: - Boolean variable to specify whether to validate SSL certificate or not. - C(true) - indicates that the SSL certificate should be verified. Set the environment variable REQUESTS_CA_BUNDLE to the path of the SSL certificate. - C(false) - indicates that the SSL certificate should not be verified. type: bool offline_availability: choices: - MANUAL - DOCUMENTS - PROGRAMS - NONE description: - Defines valid states of Offline Availability. - C(MANUAL)- Only specified files will be available offline. - C(DOCUMENTS)- All files that users open will be available offline. - C(PROGRAMS)- Program will preferably run from the offline cache even when connected to the network. All files that users open will be available offline. - C(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 C(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 C(false). type: bool is_continuous_availability_enabled: description: - Indicates whether continuous availability for SMB 3.0 is enabled. - During creation, if not mentioned, then the default is C(false). type: bool
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 file_system: contains: filesystem_type: description: Type of filesystem. sample: Primary type: str id: description: ID of filesystem. sample: 5f73f516-e67b-b179-8901-72114981c1f3 type: str name: description: Name of filesystem. sample: sample_filesystem type: str nas_server: description: nas_server of filesystem. type: dict description: Includes ID and Name of filesystem and nas server for which smb share exists. type: complex id: description: The ID of the SMB share. sample: 5efc4432-cd57-5dd0-2018-42079d64ae37 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 description: The SMB share details. returned: When share exists. sample: description: SMB Share created file_system: filesystem_type: Primary id: 61d68c36-7c59-f5d9-65f0-96e8abdcbab0 name: sample_file_system nas_server: id: 60c0564a-4a6e-04b6-4d5e-fe8be1eb93c9 name: ansible_nas_server id: 61d68cf6-34d3-7b16-0370-96e8abdcbab0 is_ABE_enabled: true is_branch_cache_enabled: true is_continuous_availability_enabled: true is_encryption_enabled: true name: sample_smb_share offline_availability: Documents path: /sample_file_system umask: '177' type: complex