fix: configuration sections are deprecated
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
Simon LEONARD 2024-02-09 18:16:01 +01:00 committed by SebClem
parent 84b0030581
commit b623f24c43
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -3,7 +3,6 @@
# Managed by Ansible, please don't edit manually
# Full config: https://torsion.org/borgmatic/docs/reference/config.yaml
location:
{% if borg_source_directories is not defined or borg_source_directories | length == 0 %}
source_directories:
- /etc/hostname # prevent empty backupconfig
@ -16,13 +15,28 @@ location:
# Stay in same file system (do not cross mount points).
one_file_system: {{ borg_one_file_system }}
{# List of... #}
repositories:
{% if borg_repository is iterable and (borg_repository is not string and borg_repository is not mapping) %}
{% for repo in borg_repository %}
- {{ repo }}
{# ...mappings #}
{% if repo is mapping and "path" in repo and "label" in repo %}
{{ [repo] | to_nice_yaml(indent=2) | trim | indent(4) }}
{# ...strings (legacy) #}
{% elif repo is string %}
- path: {{ repo }}
label: {{ repo }}
{% endif %}
{% endfor %}
{# Mapping with path and label key #}
{% elif borg_repository is defined and borg_repository is mapping and "path" in borg_repository and "label" in borg_repository %}
- path: {{ borg_repository.path }}
label: {{ borg_repository.label }}
{# String (legacy) #}
{% elif borg_repository is defined and borg_repository is string %}
- {{ borg_repository }}
- path: {{ borg_repository }}
label: {{ borg_repository }}
{% endif %}
# Store atime into archive.
@ -53,7 +67,8 @@ location:
exclude_caches: true
# Exclude directories that contain a file with the given filename.
exclude_if_present: .nobackup
exclude_if_present:
- .nobackup
# Alternate Borg remote executable. Defaults to "borg".
# remote_path: borg1
@ -115,7 +130,6 @@ storage:
# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details.
# At least one of the "keep" options is required for pruning to work.
retention:
{% if borg_retention_policy.keep_secondly is defined %}
# Number of secondly archives to keep.
keep_secondly: {{ borg_retention_policy.keep_secondly }}
@ -154,7 +168,6 @@ retention:
# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-extract for details.
consistency:
# List of one or more consistency checks to run: "repository",
# "archives", "data", and/or "extract". Defaults to
# "repository" and "archives". Set to "disabled" to disable
@ -175,7 +188,6 @@ consistency:
# IMPORTANT: All provided commands and scripts are executed with user permissions of borgmatic.
# Do not forget to set secure permissions on this file as well as on any script listed (chmod 0700) to
# prevent potential shell injection or privilege escalation.
hooks:
{% for hook in borgmatic_hooks %}
{{ hook }}:
{{ borgmatic_hooks[hook] | to_nice_yaml(indent=2) | trim | indent(8) }}