Use s3 url
This commit is contained in:
parent
15f3ba88f2
commit
fcf256a933
@ -1,13 +1,13 @@
|
||||
- set_fact:
|
||||
endpoint_without_bucket: "{{ cloudflare_r2_endpoint | urlsplit('scheme') ~ '://' ~ cloudflare_r2_endpoint | urlsplit('netloc') }}"
|
||||
endpoint_path: "{{ cloudflare_r2_endpoint | urlsplit('path') }}"
|
||||
restic_repository_name: "rclone:cloudflare-r2:backup-{{inventory_hostname}}"
|
||||
bucket_name: >-
|
||||
{{
|
||||
(cloudflare_r2_endpoint | urlsplit('path') | default('', true) | regex_replace('^/', ''))
|
||||
if (cloudflare_r2_endpoint | urlsplit('path') | default('') | length > 1)
|
||||
else (backup_bucket_prefix ~ '-' ~ inventory_hostname)
|
||||
}}
|
||||
restic_repository: "s3:{{ endpoint_without_bucket }}/{{ bucket_name }}"
|
||||
|
||||
- name: create the /backup-dirs file # this also runs on main in case someone doesn't run the backup.yml
|
||||
file:
|
||||
@ -84,7 +84,7 @@
|
||||
until: "command_result.rc==0 or 'repository master key and config already initialized' in command_result.stderr"
|
||||
failed_when: "command_result.rc!=0 and 'repository master key and config already initialized' not in command_result.stderr"
|
||||
environment:
|
||||
RESTIC_REPOSITORY: "{{ restic_repository_name }}"
|
||||
RESTIC_REPOSITORY: "{{ restic_repository }}"
|
||||
AWS_ACCESS_KEY_ID: "{{ cloudflare_r2_access_key }}"
|
||||
AWS_SECRET_ACCESS_KEY: "{{ cloudflare_r2_secret_key }}"
|
||||
tags:
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
export RESTIC_REPOSITORY="{{ restic_repository_name }}"
|
||||
AWS_ACCESS_KEY_ID="{{ cloudflare_r2_access_key }}"
|
||||
AWS_SECRET_ACCESS_KEY="{{ cloudflare_r2_secret_key }}"
|
||||
export PWD_FILE=/backup-pwd
|
||||
export RESTIC=/usr/bin/restic
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user