Using this module I run into a deprecated warning when running borgmatic:
summary:
/etc/borgmatic/config.yaml: Configuration sections (like location:, storage:, retention:, consistency:, and hooks:) are deprecated and support will be removed from a future release. To prepare for this, move your options out of sections to the global scope.
/etc/borgmatic/config.yaml: The exclude_if_present option now expects a list value. String values for this option are deprecated and support will be removed from a future release.
The fix is quite simple, but needs some adapting for the repositories list: it now expects objects with the path and label keys.
So far, I came up with this :
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
---
{# 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 %}
{# ...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 %}
- path: {{ borg_repository }}
label: {{ borg_repository }}
{% endif %}
But it's not perfect, if the label is not provided, it will use the repo path.
Hello,
Using this module I run into a deprecated warning when running borgmatic:
The fix is quite simple, but needs some adapting for the repositories list: it now expects objects with the path and label keys.
So far, I came up with this :
But it's not perfect, if the label is not provided, it will use the repo path.
This template is compatible with the following:
And will render into something like:
Full commit : https://github.com/sinux-l5d/ansible-role-borgbackup/commit/7fc5fe2dcb89c171d37beec6a02d42b217a44d84