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.