feat: Add borgmatic actions

This commit is contained in:
pulsar89.5 2023-12-20 09:56:51 +01:00
parent 18828d33bf
commit 9d4a7bfb44
4 changed files with 21 additions and 3 deletions

View File

@ -32,4 +32,6 @@ borgmatic_name: "{{ inventory_hostname }}_{now}"
borgmatic_compression: none
borgmatic_passphrase: ""
borgmatic_actions: {}
borgmatic_restore_first: false

View File

@ -1,3 +1,5 @@
# {{ ansible_managed }}
[Unit]
Description=borgmatic backup
Wants=network-online.target

View File

@ -1,3 +1,5 @@
# {{ ansible_managed }}
[Unit]
Description=Run borgmatic backup

View File

@ -1,4 +1,5 @@
---
# {{ ansible_managed }}
repositories:
{% for repository in borgmatic_repositories %}
@ -35,6 +36,17 @@ healthchecks:
- finish
- fail
keep_daily: {{ borgmatic_retention.daily }}
keep_monthly: {{ borgmatic_retention.monthly }}
keep_weekly: {{ borgmatic_retention.weekly }}
{% 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 %}