win_owner – Set owner

Synopsis

  • Set owner of files or directories.

Parameters

Parameter Choices/Defaults Comments
path
path / required
Path to be used for changing owner.
recurse
boolean
    Choices:
  • no ←
  • yes
Indicates if the owner should be changed recursively.
user
string / required
Name to be used for changing owner.

See Also

See also

win_acl – Set file/directory/registry permissions for a system user or group

The official documentation on the win_acl module.

win_file – Creates, touches or removes files or directories

The official documentation on the win_file module.

win_stat – Get information about Windows files

The official documentation on the win_stat module.

Examples

- name: Change owner of path
  win_owner:
    path: C:\apache
    user: apache
    recurse: yes

- name: Set the owner of root directory
  win_owner:
    path: C:\apache
    user: SYSTEM
    recurse: no

Status

Red Hat Support

More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.

Authors

  • Hans-Joachim Kliemeck (@h0nIg)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.