Implements the two decoupled backup streams from docs/06 as an idempotent
Ansible role wired into the host playbook:
- Files: sanoid takes/prunes ZFS snapshots per policy (sanoid_datasets) on
its packaged timer; syncoid replicates offsite (heleos-zfs-offsite),
enabled only when zfs_offsite_target is set.
- DB: heleos-db-backup (nightly systemd timer) walks the deployments dir and
dumps each DB-backed site via `docker exec mariadb-dump` into
db-backups/<customer>/<site>/{daily,weekly,monthly} with rotation
(automysqlbackup-style, adapted for the containerized DB; MYSQL_PWD keeps
the password out of the process list). heleos-db-offsite rsyncs offsite
when db_offsite_target is set.
Streams and schedules are configured in group_vars/all.yml; offsite is
opt-in via the two target vars. Updates doc 06 (implementation note), the
ansible README, and CLAUDE.md status. YAML + templates validated by render.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
533 B
Django/Jinja
17 lines
533 B
Django/Jinja
# heleos sanoid snapshot policy — managed by Ansible.
|
|
# Files stream only; DB dumps are handled separately (heleos-db-backup).
|
|
{% for d in sanoid_datasets %}
|
|
[{{ d.name }}]
|
|
use_template = {{ d.name | replace('/', '_') }}
|
|
recursive = {{ 'yes' if d.recursive else 'no' }}
|
|
{% endfor %}
|
|
|
|
{% for d in sanoid_datasets %}
|
|
[template_{{ d.name | replace('/', '_') }}]
|
|
hourly = {{ d.hourly }}
|
|
daily = {{ d.daily }}
|
|
weekly = {{ d.weekly }}
|
|
monthly = {{ d.monthly }}
|
|
autosnap = yes
|
|
autoprune = yes
|
|
{% endfor %}
|