diff --git a/templates/restic_forget_snapshots.j2 b/templates/restic_forget_snapshots.j2 index 6f03d38..c503277 100644 --- a/templates/restic_forget_snapshots.j2 +++ b/templates/restic_forget_snapshots.j2 @@ -48,16 +48,20 @@ set -euxo pipefail --prune {% endif %} {%- endmacro %} -{% macro validate_mounts %} -{% if restic_archiver__mount_required | bool %} +{% if restic_archiver__mount_required %} +{% raw %} if mountpoint -q {{ restic_archiver__mount_disk }} then echo "{{ restic_archiver__mount_disk }} is mounted" else mount -a fi -{% endif %} +{% endraw %} +{% else %} +{% macro validate_mounts() %} +# be excellent to each other! {% endmacro %} +{% endif %} # Settings for Server {{ repo['name'] | string }} {{ validate_mounts }} @@ -112,4 +116,4 @@ restic check sync {% if restic_archiver__umount_after_usage %} umount restic_archiver__mount_disk -{% restic_archiver__mount_disk %} +{% endif %} diff --git a/vars/main.yml b/vars/main.yml index a98e5cb..72c2721 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 25 # should be over ninethousand +playbook_version_number: 26 # should be over ninethousand playbook_version_path: 'role-restic_archiver_roles-ansible_github.com.version'