machine_setup/ansible/roles/zrepl/templates/zrepl.yml.j2
Tom Alexander 87c6ad5c5a
Start of zrepl role.
Currently only doing FreeBSD.
2022-10-10 22:33:23 -04:00

30 lines
835 B
Django/Jinja

jobs:
# this job takes care of snapshot creation + pruning
- name: snapjob
type: snap
filesystems: {
{% for dataset in zfs_snapshot_datasets %}
"{{dataset}}<": true,
{% endfor %}
}
# create snapshots with prefix `zrepl_` every 15 minutes
snapshotting:
type: periodic
interval: 15m
prefix: zrepl_
pruning:
keep:
# fade-out scheme for snapshots starting with `zrepl_`
# - keep all created in the last hour
# - then destroy snapshots such that we keep 24 each 1 hour apart
# - then destroy snapshots such that we keep 14 each 1 day apart
# - then destroy all older snapshots
- type: grid
grid: 1x1h(keep=all) | 24x1h | 14x1d
regex: "^zrepl_.*"
# keep all snapshots that don't have the `zrepl_` prefix
- type: regex
negate: true
regex: "^zrepl_.*"