- Jinja 93.4%
- Shell 6.6%
| defaults | ||
| files | ||
| meta | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| AGENTS.md | ||
| LICENSE | ||
| README.md | ||
ansible-roles-backlog
An Ansible role for installing per-user ZFS backup scripts, SSH configuration, ZFS permissions, and cron entries.
Task Configuration
backlog_key files are expected under files/backlog/ in the inventory
directory, the playbook directory, or this role. Inventory-local keys are
preferred, for example deploy/beta/files/backlog/<key-name>.
Each backlog_targets item configures one local user and dataset.
- name: Setup backlog
hosts: somehost
become: true
roles:
- role: backlog
backlog_key: backlog-somekey-file
backlog_targets:
- user: someservice
services:
- name: pod-someservice
type: systemd
scope: user
dataset: storage/DATA/home/someservice
retention: 3
time: "16 0 * * 0"
destinations:
- name: somehost-backlog
host: somehost.sh
data: batterywharf/DATA/backlog/someservice
Target Options
user: local user that owns the backup script and cron entry.dataset: local ZFS dataset to snapshot and send.services: services to stop before snapshot creation and restart afterward.time: five-field cron expression. If omitted,backlog_cron_timeis used.destinations: remote backup targets.nameis the SSH host alias generated in~/.ssh/config;hostis the real hostname;datais the remote dataset.template: optional script template name without.sh.j2. The role resolves this astemplates/<template>.sh.j2.
Template Versions
templates/backlog.sh.j2 is the default template used by the role. The current
template selector resolves target.template as templates/<template>.sh.j2, so
the historical templates/backlog.sh-v*.j2 files are archival unless renamed or
the task lookup is changed. Prefer updating the default template for new
behavior and remove old versioned templates once no inventory references them.
Deployment and Removal
Deploy
ansible-playbook -i hosts site.yml --tags=backlog --limit=somehost