community.general.zfs 模块 – 管理 zfs
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。 它不包含在 ansible-core
中。 要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.general
。
要在 playbook 中使用它,请指定: community.general.zfs
。
概要
管理 ZFS 文件系统、卷、克隆和快照
参数
参数 |
注释 |
---|---|
要设置的 zfs 属性的字典。 有关详细信息,请参阅 zfs(8) 手册页。 默认值: |
|
文件系统、快照或卷名称,例如 |
|
用于创建克隆的快照。 |
|
是否创建( 选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 部分 在某些情况下,它可能会报告任务已更改,但在禁用 例如,当设置了 zpool |
可以在 |
|
支持: 完全 |
当处于 diff 模式时,将返回有关已更改内容(或可能需要在 |
示例
- name: Create a new file system called myfs in pool rpool with the setuid property turned off
community.general.zfs:
name: rpool/myfs
state: present
extra_zfs_properties:
setuid: 'off'
- name: Create a new volume called myvol in pool rpool.
community.general.zfs:
name: rpool/myvol
state: present
extra_zfs_properties:
volsize: 10M
- name: Create a snapshot of rpool/myfs file system.
community.general.zfs:
name: rpool/myfs@mysnapshot
state: present
- name: Create a new file system called myfs2 with snapdir enabled
community.general.zfs:
name: rpool/myfs2
state: present
extra_zfs_properties:
snapdir: enabled
- name: Create a new file system by cloning a snapshot
community.general.zfs:
name: rpool/cloned_fs
state: present
origin: rpool/myfs@mysnapshot
- name: Destroy a filesystem
community.general.zfs:
name: rpool/myfs
state: absent