community.general.zfs – Manage zfs
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the
It is not included in
To check whether it is installed, run
ansible-galaxy collection list.
To install it, use:
ansible-galaxy collection install community.general.
To use it in a playbook, specify:
A dictionary of zfs properties to be set.
See the zfs(8) man page for more information.
File system, snapshot or volume name e.g.
Snapshot from which to create a clone.
Whether to create (
check_modeis supported, but in certain situations it may report a task as changed that will not be reported as changed when
check_modeis disabled. For example, this might occur when the zpool
altrootoption is set or when a size is written using human-readable notation, such as
1024K, instead of as an unqualified byte count, such as
- 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/[email protected] 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/[email protected] - name: Destroy a filesystem community.general.zfs: name: rpool/myfs state: absent