2026-01-16 12:30:20 -08:00
|
|
|
# {{ ansible_managed }}
|
|
|
|
|
|
2026-01-19 18:00:32 -08:00
|
|
|
# Path to borg binary (LaunchAgent doesn't have homebrew in PATH)
|
|
|
|
|
local_path: {{ borgmatic_local_path }}
|
|
|
|
|
|
2026-01-16 12:30:20 -08:00
|
|
|
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 }}
|
|
|
|
|
|
2026-03-16 21:59:10 -07:00
|
|
|
{% if borgmatic_k8s_sqlite_dumps %}
|
2026-05-13 17:17:45 -07:00
|
|
|
# Pre-backup: dump SQLite databases from k8s pods.
|
|
|
|
|
# Uses sqlite3.backup() for a safe, consistent copy.
|
|
|
|
|
#
|
|
|
|
|
# Quoting/escaping is delegated to ~/bin/borgmatic-k8s-sqlite-dump
|
|
|
|
|
# (deployed by the borgmatic ansible role). Each entry's `target`
|
|
|
|
|
# is either:
|
|
|
|
|
# - local:<context> -> local kubectl with --context (mealie etc.)
|
|
|
|
|
# - ssh:<user@host> -> ssh + k3s kubectl on the cluster host,
|
|
|
|
|
# used for ringtail since indri's kubeconfig
|
|
|
|
|
# deliberately doesn't carry that context.
|
2026-03-16 21:59:10 -07:00
|
|
|
before_backup:
|
|
|
|
|
- mkdir -p {{ borgmatic_k8s_dump_dir }}
|
|
|
|
|
{% for db in borgmatic_k8s_sqlite_dumps %}
|
2026-05-13 17:17:45 -07:00
|
|
|
- {{ ansible_env.HOME }}/bin/borgmatic-k8s-sqlite-dump {{ db.target }} {{ db.namespace }} {{ db.label_selector }} {{ db.db_path }} {{ db.name }} {{ borgmatic_k8s_dump_dir }}/{{ db.name }}.db
|
2026-03-16 21:59:10 -07:00
|
|
|
{% endfor %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2026-02-10 12:47:02 -08:00
|
|
|
ssh_command: ssh -o IdentitiesOnly=yes -i {{ borgmatic_borgbase_ssh_key_path }}
|
|
|
|
|
|
2026-01-16 12:30:20 -08:00
|
|
|
# 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 }}
|
2026-01-17 09:22:01 -08:00
|
|
|
{% if borgmatic_pg_dump_command is defined %}
|
|
|
|
|
pg_dump_command: {{ borgmatic_pg_dump_command }}
|
|
|
|
|
{% endif %}
|
2026-01-16 12:30:20 -08:00
|
|
|
{% endfor %}
|
|
|
|
|
{% endif %}
|