ansible.windows.win_share – Manage Windows shares¶
This plugin is part of the ansible.windows collection.
To install it use:
ansible-galaxy collection install ansible.windows.
To use it in a playbook, specify:
The below requirements are needed on the host that executes this module.
As this module used newer cmdlets like New-SmbShare this can only run on Windows 8 / Windows 2012 or newer.
This is due to the reliance on the WMI provider MSFT_SmbShare https://msdn.microsoft.com/en-us/library/hh830471 which was only added with these Windows releases.
- name: Add secret share ansible.windows.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 ansible.windows.win_share: name: company description: top secret share path: C:\shares\company list: yes full: Administrators,CEO read: Global - name: Remove previously added share ansible.windows.win_share: name: internal state: absent
Common return values are documented here, the following are the fields unique to this module:
list / elements=string
A list of action cmdlets that were run by the module.
['New-SmbShare -Name share -Path C:\\temp']
Hans-Joachim Kliemeck (@h0nIg)
David Baumann (@daBONDi)
Shachaf Goldstein (@Shachaf92)