No description
  • Jinja 93.4%
  • Shell 6.6%
Find a file
2026-05-29 04:26:35 +00:00
defaults initial commit 2025-10-06 22:03:16 +00:00
files initial commit 2025-10-06 22:03:16 +00:00
meta update template, add heartbeat 2026-04-05 18:37:05 +00:00
tasks support inventory backlog keys 2026-05-19 20:48:32 +00:00
templates Codex: templates/backlog.sh.j2:308 can leave services stopped if services stop partially fails. SERVICES_STOPPED=true is only set after the whole stop sequence returns, so if the first service stops and a later service fails, the EXIT trap will not restart anything. Set the flag before stopping, or track stopped services individually and restart only those. 2026-05-29 04:26:35 +00:00
.gitignore initial commit 2025-10-06 22:03:16 +00:00
AGENTS.md update contributor workflow guidance 2026-05-19 20:11:50 +00:00
LICENSE initial commit 2025-10-06 22:03:16 +00:00
README.md support inventory backlog keys 2026-05-19 20:48:32 +00:00

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_time is used.
  • destinations: remote backup targets. name is the SSH host alias generated in ~/.ssh/config; host is the real hostname; data is the remote dataset.
  • template: optional script template name without .sh.j2. The role resolves this as templates/<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