~xenrox/ansible

9d498636a95fce15d713e1be71155415acae60d3 — Thorben Günther 2 months ago d1b079f
borg: Improve backup script

set -e, only install docker backup script if there are docker services.
2 files changed, 4 insertions(+), 2 deletions(-)

M roles/borg/tasks/main.yml
M roles/borg/templates/borg-backup.sh.j2
M roles/borg/tasks/main.yml => roles/borg/tasks/main.yml +1 -1
@@ 116,4 116,4 @@
    owner: root
    group: root
    mode: 0755
  when: docker_services is defined
  when: docker_services is defined and docker_services is iterable

M roles/borg/templates/borg-backup.sh.j2 => roles/borg/templates/borg-backup.sh.j2 +3 -1
@@ 1,5 1,7 @@
#!/bin/bash

set -e

export BORG_REPO=ssh://{{ borg_user }}@{{ borg_user }}.your-storagebox.de:23/./borg
export BORG_PASSCOMMAND='cat /etc/.secrets/borg.pass'



@@ 29,7 31,7 @@ fi
backup-sqlite.sh
{% endif %}

{% if docker_services is defined %}
{% if docker_services is defined and docker_services is iterable %}
backup-docker.sh
{% endif %}