ZFS

ZFS (Zettabyte FileSystem) storage pool. See ZFS Tutorial (outdated, but good for concepts).

Ansible Role: zfs

Import ZFS datasets and setup ZFS incremental snapshots on system.

None

Role Details: Updated: 2022-10-09 service docs PRIVATE

Defaults

---
###############################################################################
# ZFS Management & Backup Configuration
###############################################################################
# List of ZFS pools to mount.

zfs_pools: []

###############################################################################
# ZFS Snapshot User
###############################################################################
# User for running snapshot backups (local). User will be given mount,destroy
# permissions on zfs_datasets to allow for pruning of snapshots.
#
# NOTE: A user created ZFS account is prefered as key-based SSH authentication
# is used for off-machine backups.

zfs_user:  'zfs_snapshot'
zfs_group: 'zfs_snapshot'
# Create zfs user using role defaults if not detected for snapshot creation.
zfs_create_user: false

###############################################################################
# ZFS Incremental Snapshots Configuration
###############################################################################
# Enable ZFS snapshots (snapshots can be enabled but the sync cronjob disabled)

zfs_incremental_snapshots: false

# List of datasets to take incremental snapshots
# datasets are sync'ed recursively, so only the root dataset needs to be listed
# to sync.
zfs_datasets: []

# Backup server
zfs_remote_server:           ''
zfs_remote_user:             '{{ zfs_user }}'
zfs_remote_port:             ''
zfs_remote_pool:             ''
zfs_remote_command_prefix:   'sudo'
zfs_remote_ssh_options:      '(-i /root/backup/backup.key)'

# Enable weekly snapshot sync
zfs_enable_snapshots_weekly: false
# prefix to use for snapshots created
zfs_snapshot_prefix:         'zincrsend_'
# Keep X number of snapshots after sync. Default: 2, 0 disables
# NOTE: There must be two snapshots existing for incremental send to work.
zfs_snapshot_retention:      2
# snapshot options: https://openzfs.github.io/openzfs-docs/man/8/zfs-snapshot.8.html
zfs_snapshot_opts:           '(-r)'
# send options: https://openzfs.github.io/openzfs-docs/man/8/zfs-send.8.html
zfs_send_opts:               '(-R -w)'