Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Commit

Permalink
Add support for more backends (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom authored and donat-b committed Jan 7, 2018
1 parent 33524c6 commit 5c064b4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions templates/restic.cron.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@
# restic backup jobs
# vi: ft=jinja.crontab

# {{ ansible_managed }}
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
AWS_ACCESS_KEY_ID="{{ item.aws_access_key_id | default('') }}"
AWS_SECRET_ACCESS_KEY="{{ item.aws_secret_access_key | default('') }}"
RESTIC_REPOSITORY="{{ item.url }}"
RESTIC_PASSWORD="{{ item.password }}"
{% if aws_access_key_id in item %}
AWS_ACCESS_KEY_ID="{{ item.aws_access_key_id }}"
AWS_SECRET_ACCESS_KEY="{{ item.aws_secret_access_key }}"
{% elif b2_account_id in item %}
B2_ACCOUNT_ID="{{ item.b2_account_id }}"
B2_ACCOUNT_KEY="{{ item.b2_account_key }}"
{% elif azure_account_name in item %}
AZURE_ACCOUNT_NAME="{{ item.azure_account_name }}"
AZURE_ACCOUNT_KEY="{{ item.azure_account_key }}"
{% elif os_storage_url in item %}
OS_STORAGE_URL="{{ item.os_storage_url }}"
OS_AUTH_TOKEN="{{ item.os_auth_token }}"
{% endif %}
{% set restic_stdin = '| restic backup --stdin' %}
{% macro tags(tags) -%}
{% if tags is defined %}{% for tag in tags %} --tag {{ tag }}{% endfor %}{% endif %}
Expand Down

0 comments on commit 5c064b4

Please sign in to comment.