You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
zfs - Manage zfs
- Manages ZFS file systems, volumes, clones and snapshots
Parameter |
Choices/Defaults |
Comments |
extra_zfs_properties
(added in 2.5) |
|
A dictionary of zfs properties to be set.
See the zfs(8) man page for more information.
|
key_value
|
|
(**DEPRECATED**) This will be removed in Ansible-2.9. Set these values in the
extra_zfs_properties option instead.
The zfs module takes key=value pairs for zfs properties to be set.
See the zfs(8) man page for more information.
|
name
required |
|
File system, snapshot or volume name e.g. rpool/myfs .
|
origin
|
|
Snapshot from which to create a clone.
|
state
required |
|
Whether to create (present ), or remove (absent ) a file system, snapshot or volume. All parents/children will be created/destroyed as needed to reach the desired state.
|
- name: Create a new file system called myfs in pool rpool with the setuid property turned off
zfs:
name: rpool/myfs
state: present
extra_zfs_properties:
setuid: off
- name: Create a new volume called myvol in pool rpool.
zfs:
name: rpool/myvol
state: present
extra_zfs_properties:
volsize: 10M
- name: Create a snapshot of rpool/myfs file system.
zfs:
name: rpool/myfs@mysnapshot
state: present
- name: Create a new file system called myfs2 with snapdir enabled
zfs:
name: rpool/myfs2
state: present
extra_zfs_properties:
snapdir: enabled
- name: Create a new file system by cloning a snapshot
zfs:
name: rpool/cloned_fs
state: present
origin: rpool/myfs@mysnapshot
- name: Destroy a filesystem
zfs:
name: rpool/myfs
state: absent
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
- Johan Wiren (@johanwiren)
Hint
If you notice any issues in this documentation you can edit this document to improve it.