mirror of
https://github.com/roles-ansible/ansible_role_restic.git
synced 2024-12-11 23:41:32 +01:00
20 lines
866 B
Django/Jinja
20 lines
866 B
Django/Jinja
#!/usr/bin/env bash
|
|
# {{ ansible_managed }}
|
|
# Backup credentials for {{ item.src|default('stdin') }}
|
|
# Source this file to work with restic on this host
|
|
|
|
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
|
|
export RESTIC_PASSWORD="{{ restic_repos[item.repo].password | regex_escape() }}"
|
|
{% if restic_repos[item.repo].aws_access_key is defined %}
|
|
export AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
|
|
{% endif %}
|
|
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
|
|
export AWS_SECRET_ACCESS_KEY="{{ restic_repos[item.repo].aws_secret_access_key | regex_escape() }}"
|
|
{% endif %}
|
|
{% if restic_repos[item.repo].aws_default_region is defined %}
|
|
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
|
|
{% endif %}
|
|
BACKUP_NAME={{ item.name }}
|
|
{% if item.src is defined %}
|
|
BACKUP_SOURCE={{ item.src }}
|
|
{% endif %}
|