You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Ansible role to install and configure automated ZFS snapshots and replication using Sanoid/Syncoid managed by systemd timers, with optional Healthchecks.io support via runitor
Requirements
ZFS
systemd
In order for Syncoid to replicate to a remote host, you must ensure that SSH access via public key authentication is correctly set up for the relevant users
Role Variables
Installation
Variable
Default
Comments
sanoid_install_from
"package"
Install Sanoid from OS package or from GitHub
syncoid_healthchecks_install_runitor
false
Install runitor for Healthchecks.io support When set to true, will install runitor only if there is at least one syncoid_syncs entry with healthchecks defined
All settings supported by Sanoid in templates are supported - see sanoid.conf and sanoid.defaults.conf for details
Similarly, most Syncoid flags are configurable via syncoid_syncs.
sanoid_datasets[]
Variable
Default
Comments
name
Required
ZFS dataset to snapshot
templates
Required
Sanoid template(s) to use for policy
recursive
"no"
Include child datasets with this dataset
process_children_only
"no"
Do not include this dataset
overrides
[]
List of template settings to override
systemd Settings
Variable
Default
Comments
sanoid_service_pre_start
[]
Add ExecStartPre commands to the Sanoid systemd service file
sanoid_service_post_start
[]
Add ExecStartPost commands to the Sanoid systemd service file
sanoid_prune_service_pre_start
[]
Add ExecStartPre commands to the Sanoid Prune systemd service file
sanoid_prune_service_post_start
[]
Add ExecStartPost commands to the Sanoid Prune systemd service file
Syncoid Configuration
Variable
Default
Comments
syncoid_syncs
[]
List of datasets to replicate
syncoid_send_options
""
Default additional options to pass to the zfs send command via syncoid --sendoptions
syncoid_recv_options
""
Default additional options to pass to the zfs recieve command via syncoid --recvoptions
syncoid_use_ssh_key
yes
Use an SSH key to login to remote hosts
syncoid_generate_ssh_key
yes
Generate an SSH key for Syncoid to use
syncoid_generated_ssh_key
id_syncoid
Name of generated SSH key
syncoid_ssh_key
/root/.ssh/{syncoid_generated_ssh_key | id_rsa }
Path to SSH key for Syncoid to use
syncoid_ssh_key_install_remote
yes
Install specified SSH key on remote hosts. Requires remote hosts to be defined in inventory
syncoid_update_known_hosts
yes
Update known_hosts with src/destination host public keys.
syncoid_syncs[]
A separate systemd service will be generated for each sync listed, grouped into a single systemd target triggered by a systemd timer. The generated services are configured to run one at a time, in the order they are listed
Variable
Default
Comments
name
Auto-generated
Name to use for the generated systemd service. Specifying a human-readable name is highly recommended
src
Required
Source ZFS dataset
src_host
""
Source host
src_user
"root"
Source user. Ignored if src_host empty
dest
Required
Destination ZFS dataset
dest_host
""
Destination host
dest_user
"root"
Destination user. Ignored if dest_host empty
recursive
"no"
Copy child datasets
force_delete
"no"
Remove destination datasets recursively
send_options
""
Additional options to pass to the zfs send command via syncoid --sendoptions
recv_options
""
Additional options to pass to the zfs recieve command via syncoid --recvoptions
systemd Settings
Variable
Default
Comments
syncoid_service_name
"syncoid"
Name to use for the Syncoid systemd target, and the prefix to use for the individual systemd sync services
syncoid_timer_frequency
"daily"
systemd service frequency for Syncoid
syncoid_syncs[].systemd.pre_start
[]
Add ExecStartPre commands to the systemd service file for the specific sync
syncoid_syncs[].systemd.post_start
[]
Add ExecStartPost commands to the systemd service file for the specific sync