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