Correct the condition for skipping creation of the bucket

This commit is contained in:
Kuba Orlik 2026-06-03 22:32:29 +02:00
parent 74ed506696
commit 1fc2b6d698

View File

@ -56,11 +56,6 @@
force: yes force: yes
backup: yes backup: yes
- debug:
msg:
- "endpoint={{ cloudflare_r2_endpoint }}"
- "path={{ cloudflare_r2_endpoint | urlsplit('path') }}"
- name: "Create a bucket for the backups" - name: "Create a bucket for the backups"
amazon.aws.s3_bucket: amazon.aws.s3_bucket:
name: "{{ backup_bucket_prefix }}-{{ inventory_hostname }}" name: "{{ backup_bucket_prefix }}-{{ inventory_hostname }}"
@ -68,7 +63,7 @@
endpoint_url: "{{ cloudflare_r2_endpoint }}" endpoint_url: "{{ cloudflare_r2_endpoint }}"
access_key: "{{ cloudflare_r2_access_key }}" access_key: "{{ cloudflare_r2_access_key }}"
secret_key: "{{ cloudflare_r2_secret_key }}" secret_key: "{{ cloudflare_r2_secret_key }}"
when: (cloudflare_r2_endpoint | urlsplit('path') | default('')) | length > 0 when: (cloudflare_r2_endpoint | urlsplit('path') | default('')) | length < 1
- name: initiate restic repository - name: initiate restic repository
command: "restic init --password-file=/backup-pwd" command: "restic init --password-file=/backup-pwd"