ansible.windows.win_owner 模块 – 设置所有者
注意
此模块是 ansible.windows 集合 (版本 2.5.0) 的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install ansible.windows
。
要在 playbook 中使用它,请指定:ansible.windows.win_owner
。
概要
设置文件或目录的所有者。
参数
参数 |
注释 |
---|---|
用于更改所有者的路径。 |
|
指示是否应递归更改所有者。 选项
|
|
用于更改所有者的名称。 此值可以是 SecurityIdentifier 字符串、Netlogon 中的用户或组 |
另请参阅
另请参阅
- ansible.windows.win_acl
为系统用户或组设置文件/目录/注册表/证书权限。
- ansible.windows.win_file
创建、触摸或删除文件或目录。
- ansible.windows.win_stat
获取有关 Windows 文件的信息。
示例
- 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