community.general.zfs_delegate_admin 模块 – 管理 ZFS 委派管理(用户管理权限)
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。 它不包含在 ansible-core
中。 要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:community.general.zfs_delegate_admin
。
概要
管理 ZFS 文件系统委派管理权限,允许非特权用户执行通常仅限于超级用户的 ZFS 操作。
有关选项的详细说明,请参阅
zfs(1M)
的zfs allow
部分。此模块尝试尽可能地遵守命令行工具的行为。
要求
在执行此模块的主机上需要满足以下要求。
支持使用
zfs allow
进行委派的 ZFS/OpenZFS 实现,包括:Solaris >= 10、illumos(所有版本)、FreeBSD >= 8.0R、Linux 上的 ZFS >= 0.7.0。
参数
参数 |
注释 |
---|---|
将权限应用于所有人。 选择
|
|
应向其授予权限的组列表。 |
|
文件系统或卷名称,例如 |
|
要委派的权限列表(如果 支持的权限取决于所使用的 ZFS 版本。 例如,请参阅 https://openzfs.github.io/openzfs-docs/man/8/zfs-allow.8.html OpenZFS。 |
|
应授予权限的用户的列表。 |
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 无 |
可以在 |
|
支持: 无 |
当处于差异模式时,将返回已更改内容(或可能需要在 |
示例
- name: Grant `zfs allow` and `unallow` permission to the `adm` user with the default local+descendents scope
community.general.zfs_delegate_admin:
name: rpool/myfs
users: adm
permissions: allow,unallow
- name: Grant `zfs send` to everyone, plus the group `backup`
community.general.zfs_delegate_admin:
name: rpool/myvol
groups: backup
everyone: true
permissions: send
- name: Grant `zfs send,receive` to users `foo` and `bar` with local scope only
community.general.zfs_delegate_admin:
name: rpool/myfs
users: foo,bar
permissions: send,receive
local: true
- name: Revoke all permissions from everyone (permissions specifically assigned to users and groups remain)
community.general.zfs_delegate_admin:
name: rpool/myfs
everyone: true
state: absent