2025-09-13 00:06:27 +02:00
2025-09-12 21:00:45 +02:00
2025-09-13 00:11:17 +02:00
2025-09-13 00:11:17 +02:00
2025-09-13 00:37:27 +02:00

Sets up backups to Cloudflare R2

Instalation

In requirements.yml:

roles:
  - src: git+https://git.internet-czas-dzialac.pl/kuba/ansible-setup-backups.git
    version: master
    name: setup-backups

Setup

Create a Cloudflare R2 account and create an admin token.

Create a file under templates/backup-scripts/<hostname>.sh.j2 that is a shell script that prepares the data for backup - leave empty if not necessary.

Then in your playbook run:


- name: "Setup backups"
  hosts: ansible1
  roles:
    - setup-backups
  vars:
    backup_bucket_prefix: "backup"
    all_backup_paths:
      - /var/homebox/data
    cloudflare_r2_access_key: "cloudflare R2 Access key (for S3-type API)"
    cloudflare_r2_secret_key: "cloudflare R2 secret key (for S3-type API)"
    cloudflare_r2_endpoint: https://some_endpoint.r2.cloudflarestorage.com
    BACKUP_PASSWORD: password
Description
No description provided
Readme 48 KiB
Languages
Jinja 100%