refactor: harden restic configuration

move secrets to .env file so they work on their own, initialize restic repo on fresh deployments
This commit is contained in:
2026-07-12 23:46:29 +02:00
parent c4c8d6de7f
commit 71a02e0f86
5 changed files with 47 additions and 11 deletions
+7 -7
View File
@@ -1,17 +1,17 @@
#!/bin/bash
## Ansible managed
## Secrets are passed via Ansible Vault variables
export RESTIC_REPOSITORY="{{ vault_restic_repo_url }}"
export RESTIC_PASSWORD="{{ vault_restic_password }}"
export AWS_ACCESS_KEY_ID="{{ vault_aws_access_key }}"
export AWS_SECRET_ACCESS_KEY="{{ vault_aws_secret_key }}"
set -e
# Source environment variables if running manually/outside Systemd
if [ -f /etc/restic-backup.env ]; then
# shellcheck source=/dev/null
. /etc/restic-backup.env
fi
echo "Starting Restic Backup at $(date)"
## Run the backup using paths and exclusions defined in group_vars
## Run the backup using paths and exclusions defined as group_vars
restic backup \
{% for path in backup_include_paths %}
"{{ path }}" \