Adds a second borgmatic repository targeting BorgBase (US region) for offsite backups, completing a 3-2-1 backup strategy. SSH key is managed via 1Password and deployed by Ansible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
1.4 KiB
Django/Jinja
53 lines
1.4 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
# Path to borg binary (LaunchAgent doesn't have homebrew in PATH)
|
|
local_path: {{ borgmatic_local_path }}
|
|
|
|
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 }}
|
|
|
|
ssh_command: ssh -i {{ borgmatic_borgbase_ssh_key_path }}
|
|
|
|
# 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)
|
|
postgresql_databases:
|
|
{% for db in borgmatic_postgresql_databases %}
|
|
- name: {{ db.name }}
|
|
hostname: {{ db.hostname | default('localhost') }}
|
|
port: {{ db.port | default(5432) }}
|
|
username: {{ db.username }}
|
|
{% if borgmatic_pg_dump_command is defined %}
|
|
pg_dump_command: {{ borgmatic_pg_dump_command }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|