ansible.windows.win_owner module – Set owner

Note

This module is part of the ansible.windows collection (version 2.5.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install ansible.windows.

To use it in a playbook, specify: ansible.windows.win_owner.

Synopsis

  • Set owner of files or directories.

Parameters

Parameter

Comments

path

path / required

Path to be used for changing owner.

recurse

boolean

Indicates if the owner should be changed recursively.

Choices:

  • false ← (default)

  • true

user

string / required

Name to be used for changing owner.

This value can be in the form of a SecurityIdentifier string, a user or group in the Netlogon DOMAIN\User or UPN format (user@DOMAIN.COM).

See Also

See also

ansible.windows.win_acl

Set file/directory/registry/certificate permissions for a system user or group.

ansible.windows.win_file

Creates, touches or removes files or directories.

ansible.windows.win_stat

Get information about Windows files.

Examples

- name: Change owner of path
  ansible.windows.win_owner:
    path: C:\apache
    user: apache
    recurse: true

- name: Set the owner of root directory
  ansible.windows.win_owner:
    path: C:\apache
    user: SYSTEM
    recurse: false

Authors

  • Hans-Joachim Kliemeck (@h0nIg)