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
