blumeops/ansible/roles/borgmatic/templates/config.yaml.j2
Erich Blume 912f2e3a82 Fix borgmatic PostgreSQL backup and update backup sources
- Add explicit pg_dump_command path to fix "pg_dump: command not found"
  error when running via LaunchAgent (no homebrew in PATH)
- Remove kiwix-tools from backups (was just symlinks, ZIM archives are
  re-downloadable via torrent)
- Enable Loki log backup by removing from exclude_patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 08:48:16 -08:00

48 lines
1.3 KiB
Django/Jinja

# {{ ansible_managed }}
source_directories:
{% for dir in borgmatic_source_directories %}
- {{ dir }}
{% endfor %}
source_directories_must_exist: true
repositories:
{% for repo in borgmatic_repositories %}
- path: {{ repo.path }}
label: {{ repo.label }}
{% if repo.encryption is defined %}
encryption: {{ repo.encryption }}
{% endif %}
{% if repo.append_only is defined %}
append_only: {{ repo.append_only | lower }}
{% endif %}
{% endfor %}
{% if borgmatic_exclude_patterns %}
exclude_patterns:
{% for pattern in borgmatic_exclude_patterns %}
- {{ pattern }}
{% endfor %}
{% endif %}
encryption_passcommand: {{ borgmatic_encryption_passcommand }}
# Retention policy
keep_daily: {{ borgmatic_keep_daily }}
keep_monthly: {{ borgmatic_keep_monthly }}
keep_yearly: {{ borgmatic_keep_yearly }}
{% if borgmatic_postgresql_databases %}
# PostgreSQL database backups (streamed via pg_dump)
{% if borgmatic_pg_dump_command is defined %}
pg_dump_command: {{ borgmatic_pg_dump_command }}
{% endif %}
postgresql_databases:
{% for db in borgmatic_postgresql_databases %}
- name: {{ db.name }}
hostname: {{ db.hostname | default('localhost') }}
port: {{ db.port | default(5432) }}
username: {{ db.username }}
{% endfor %}
{% endif %}