damex.cloudflare.cloudflare_r2_buckets role – Ensure Cloudflare R2 buckets.
Note
This role is part of the damex.cloudflare collection (version 1.1.1).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it use: ansible-galaxy collection install damex.cloudflare.
To use it in a playbook, specify: damex.cloudflare.cloudflare_r2_buckets.
Entry point main – Ensure Cloudflare R2 buckets.
Synopsis
Ensure Cloudflare R2 object storage buckets.
Parameters
Parameter |
Comments |
|---|---|
R2 buckets to ensure. |
|
Cloudflare account API key. |
|
Cloudflare account email. |
|
Cloudflare account identifier. |
|
Cloudflare account name. |
|
Cloudflare API token. |
|
Bucket location hint. Choices:
|
|
Bucket name. |
|
Bucket state. Choices:
|
|
Default storage class. Choices:
|
|
Cloudflare account API key. |
|
Cloudflare account email. |
|
Cloudflare account identifier. |
|
Cloudflare account name. |
|
Cloudflare API token. |
|
Default bucket location hint. Choices:
|
|
Default bucket state. Choices:
|
|
Default storage class. Choices:
|
Examples
- name: Ensure cloudflare R2 buckets
hosts: all
tasks:
- name: Ensure cloudflare R2 buckets
ansible.builtin.import_role:
name: damex.cloudflare.cloudflare_r2_buckets
vars:
cloudflare_r2_buckets_account_id: 023e105f4ecef8ad9ca31a8372d0c353
cloudflare_r2_buckets_api_token: "{{ cloudflare_api_token }}"
cloudflare_r2_buckets:
- name: backups
location_hint: weur
- name: media
storage_class: InfrequentAccess
- name: old-bucket
state: absent