win_mapped_drive - Add WebDAV information (#67111)

This commit is contained in:
Jordan Borean 2020-02-05 13:23:52 +10:00 committed by GitHub
parent 12e3adb23a
commit f23cee2145
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@ version_added: '2.4'
short_description: Map network drives for users short_description: Map network drives for users
description: description:
- Allows you to modify mapped network drives for individual users. - Allows you to modify mapped network drives for individual users.
- Also support WebDAV endpoints in the UNC form.
options: options:
letter: letter:
description: description:
@ -35,6 +36,12 @@ options:
path: path:
description: description:
- The UNC path to map the drive to. - The UNC path to map the drive to.
- If pointing to a WebDAV location this must still be in a UNC path in the
format C(\\hostname\path) and not a URL, see examples for more details.
- To specify a C(https) WebDAV path, add C(@SSL) after the hostname. To
specify a custom WebDAV port add C(@<port num>) after the C(@SSL) or
hostname portion of the UNC path, e.g. C(\\server@SSL@1234) or
C(\\server@1234).
- This is required if C(state=present). - This is required if C(state=present).
- If C(state=absent) and I(path) is not set, the module will delete the - If C(state=absent) and I(path) is not set, the module will delete the
mapped drive regardless of the target. mapped drive regardless of the target.
@ -69,6 +76,10 @@ notes:
- If become or CredSSP is not available, the I(username) and I(password) - If become or CredSSP is not available, the I(username) and I(password)
options can be used for the initial authentication but these are not options can be used for the initial authentication but these are not
persisted. persisted.
- WebDAV paths must have the WebDAV client feature installed for this module to
map those paths. This is installed by default on desktop Windows editions but
Windows Server hosts need to install the C(WebDAV-Redirector) feature using
M(win_feature).
seealso: seealso:
- module: win_credential - module: win_credential
author: author:
@ -121,6 +132,23 @@ EXAMPLES = r'''
state: present state: present
username: '{{ ansible_user }}' username: '{{ ansible_user }}'
password: '{{ ansible_password }}' password: '{{ ansible_password }}'
# This should only be required for Windows Server OS'
- name: Ensure WebDAV client feature is installed
win_feature:
name: WebDAV-Redirector
state: present
register: webdav_feature
- name: Reboot after installing WebDAV client feature
win_reboot:
when: webdav_feature.reboot_required
- name: Map the HTTPS WebDAV location
win_mapped_drive:
letter: W
path: \\live.sysinternals.com@SSL\tools # https://live.sysinternals.com/tools
state: present
''' '''
RETURN = r''' RETURN = r'''