From fa719dfce12ceeff73ee9c41e9e561c8de18fe62 Mon Sep 17 00:00:00 2001 From: Frank Dornheim <524257+conloos@users.noreply.github.com> Date: Sun, 5 Mar 2023 14:05:29 +0100 Subject: [PATCH] - "borg_source_directories" is not longer a required Argument - add "borg_keys_directory" to load key from Service user during starting borgmatic by sudo --- templates/config.yaml.j2 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/config.yaml.j2 b/templates/config.yaml.j2 index c5148ee..af17a5e 100644 --- a/templates/config.yaml.j2 +++ b/templates/config.yaml.j2 @@ -1,11 +1,18 @@ #jinja2: lstrip_blocks: "True", trim_blocks: "True" --- +# 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: -{% for dir in borg_source_directories %} + - /etc/hostname # prevent empty backupconfig +{% else %} + source_directories: + {% for dir in borg_source_directories %} - {{ dir }} -{% endfor %} + {% endfor %} +{% endif %} # Stay in same file system (do not cross mount points). one_file_system: {{ borg_one_file_system }} @@ -103,6 +110,10 @@ storage: # Bypass Borg error about a repository that has been moved. relocated_repo_access_is_ok: {{ borgmatic_relocated_repo_access_is_ok }} + # Path for Borg encryption key files. Defaults to + # $borg_base_directory/.config/borg/keys + borg_keys_directory: /home/{{ borgbackup_user }}/.config/borg/keys + # 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.