ansible / ansible.builtin / v2.9.17 / module / win_share Manage Windows shares | "added in version" 2.1 of ansible.builtin" Authors: Hans-Joachim Kliemeck (@h0nIg), David Baumann (@daBONDi) preview | supported by coreansible.builtin.win_share (v2.9.17) — module
pip
Install with pip install ansible==2.9.17
Add, modify or remove Windows share and set share permissions.
# Playbook example # Add share and set permissions --- - name: Add secret share win_share: name: internal description: top secret share path: C:\shares\internal list: no full: Administrators,CEO read: HR-Global deny: HR-External
- name: Add public company share win_share: name: company description: top secret share path: C:\shares\company list: yes full: Administrators,CEO read: Global
- name: Remove previously added share win_share: name: internal state: absent
deny: description: - Specify user list that should get no access, regardless of implied access on share, separated by comma. type: str full: description: - Specify user list that should get full access on share, separated by comma. type: str list: default: false description: - Specify whether to allow or deny file listing, in case user has no permission on share. Also known as Access-Based Enumeration. type: bool name: description: - Share name. required: true type: str path: description: - Share directory. required: true type: path read: description: - Specify user list that should get read access on share, separated by comma. type: str state: choices: - absent - present default: present description: - Specify whether to add C(present) or remove C(absent) the specified share. type: str change: description: - Specify user list that should get read and write access on share, separated by comma. type: str encrypt: default: false description: Sets whether to encrypt the traffic to the share or not. type: bool version_added: '2.4' version_added_collection: ansible.builtin description: description: - Share description. type: str caching_mode: choices: - BranchCache - Documents - Manual - None - Programs - Unknown default: Manual description: - Set the CachingMode for this share. type: str version_added: '2.3' version_added_collection: ansible.builtin
actions: description: A list of action cmdlets that were run by the module. returned: success sample: - New-SmbShare -Name share -Path C:\temp type: list