W3cubDocs

/Ansible

zfs - Manage zfs

Synopsis

Manages ZFS file systems, volumes, clones and snapshots.

Options

parameter required default choices comments
key_value
no
The zfs module takes key=value pairs for zfs properties to be set. See the zfs(8) man page for more information.
name
yes
File system, snapshot or volume name e.g. rpool/myfs
origin
no
Snapshot from which to create a clone
state
yes
  • present
  • absent
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.

Examples

# Create a new file system called myfs in pool rpool with the setuid property turned off
- zfs: name=rpool/myfs state=present setuid=off

# Create a new volume called myvol in pool rpool.
- zfs: name=rpool/myvol state=present volsize=10M

# Create a snapshot of rpool/myfs file system.
- zfs: [email protected] state=present

# Create a new file system called myfs2 with snapdir enabled
- zfs: name=rpool/myfs2 state=present snapdir=enabled

# Create a new file system by cloning a snapshot
- zfs: name=rpool/cloned_fs state=present [email protected]

# Destroy a filesystem
- zfs: name=rpool/myfs state=absent

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/zfs_module.html