W3cubDocs

/Ansible

win_share - Manage Windows shares

New in version 2.1.

Synopsis

Add, modify or remove Windows share and set share permissions.

Requirements (on host that executes module)

  • Windows 8.1 / Windows 2012 or newer

Options

parameter required default choices comments
change
no none
Specify user list that should get read and write access on share, separated by comma.
deny
no none
Specify user list that should get no access, regardless of implied access on share, separated by comma.
description
no none
Share description
full
no none
Specify user list that should get full access on share, separated by comma.
list
no none
  • True
  • False
Specify whether to allow or deny file listing, in case user got no permission on share
name
yes
Share name
path
yes
Share directory
read
no none
Specify user list that should get read access on share, separated by comma.
state
no present
  • present
  • absent
Specify whether to add present or remove absent the specified share

Examples

# 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

# Remove previously added share
  win_share:
    name: internal
    state: absent

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/win_share_module.html