role_borgmatic/templates/config.yaml.j2

53 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-03-06 23:13:54 +00:00
---
2023-12-20 08:56:51 +00:00
# {{ ansible_managed }}
2023-03-06 23:13:54 +00:00
2023-07-28 07:03:59 +00:00
repositories:
{% for repository in borgmatic_repositories %}
- label: {{ repository.label }}
path: {{ repository.path }}
{% endfor %}
2023-12-18 16:12:52 +00:00
{% if borgmatic_exclude_patterns | length > 0 %}
2023-07-28 07:03:59 +00:00
exclude_patterns:
{% for pattern in borgmatic_exclude_patterns %}
- {{ pattern }}
{% endfor %}
2023-12-18 16:12:52 +00:00
{% endif %}
2023-07-28 07:03:59 +00:00
source_directories:
{% for directory in borgmatic_source_directories %}
- {{ directory }}
{% endfor %}
archive_name_format: {{ borgmatic_name }}
compression: {{ borgmatic_compression }}
encryption_passphrase: {{ borgmatic_passphrase }}
2023-12-19 15:46:21 +00:00
checks:
2023-07-28 07:03:59 +00:00
{% for check in borgmatic_checks %}
2023-12-19 15:46:21 +00:00
- name: {{ check.name }}
frequency: {{ check.frequency }}
2023-07-28 07:03:59 +00:00
{% endfor %}
2023-03-06 23:13:54 +00:00
2023-12-19 14:50:13 +00:00
healthchecks:
ping_url: {{ borgmatic_healthchecks }}
send_logs: false
states:
- finish
- fail
2023-03-06 23:13:54 +00:00
2023-12-20 08:56:51 +00:00
{% if borgmatic_retention | length > 0 %}
{% for param, value in borgmatic_retention.items() %}
keep_{{ param }}: {{ value }}
{% endfor %}
{% endif %}
{% if borgmatic_actions | length > 0 %}
{% for param, values in borgmatic_actions.items() %}
{{ param }}:
{% for value in values %}
- {{ value }}
{% endfor %}
{% endfor %}
{% endif %}