ansible-collection-famedly-.../roles/rclone_serve
2023-11-08 23:34:39 +01:00
..
defaults chore(rclone_serve): allow adding arguments directly into rclone_serve, update README 2023-11-06 10:34:24 +01:00
handlers feat(rclone_serve): initial implementation 2023-10-25 16:17:52 +02:00
tasks feat(rclone_serve): initial implementation 2023-10-25 16:17:52 +02:00
templates feat(rclone_serve): initial implementation 2023-10-25 16:17:52 +02:00
vars chore(rclone_serve): fix lints 2023-11-08 23:34:39 +01:00
README.md chore(rclone_serve): allow adding arguments directly into rclone_serve, update README 2023-11-06 10:34:24 +01:00

famedly.base.rclone_serve ansible role deploying rclone in a docker container

This role is intended to have rclone with the serve command permanently deployed inside a docker container to translate from the supported protocols (eg. restic) to the supported backend storages (eg. Scaleway S3).

Role Variables

For configuration consult the official documentation. This role does not verify your config or flags as there are too many combinations. Check the container logs for error messages. By default the server will listen on all container addresses on port 8080.

Required Variables

  • rclone_serve_protocol has to be set to one of the supported protocols.
  • rclone_serve_backend_config is a dict that contains the configuration of the storage backend. See the example playbook below

Optional Variables

Use the rclone_serve_flags dict for adding or overriding default command line flags like so:

rclone_serve_flags:
  addr: "172.35.1.1:8076"
  htpasswd: "{{ rclone_serve_htpasswd_file }}"
  private-repos:
  append-only:

When single-dash flags need to be passed to rclone (such as -v), use rclone_serve_args to list those options in an array.

For more variables see defaults/main.yml file.

Dependencies

  • sivel.toiletwater ansible collection for ini templating
  • Docker and python docker bindings (usually python3-docker or pip3 install docker) on the target host

Example Playbook

- hosts: ["my_rclone_host"]
  become: true
  roles:
    - role: rclone_serve
  vars:
    rclone_serve_protocol: "restic"
    rclone_serve_backend_path: "my_scw_bucket_name"
    rclone_serve_backend_config:
      type: "s3"
      provider: "Scaleway"
      env_auth: false
      endpoint: "s3.nl-ams.scw.cloud"
      access_key_id: "SCWXXXXXXXXXXXXXX"
      secret_access_key: "1111111-2222-3333-44444-55555555555555"
      region: "nl-ams"
    rclone_serve_flags:
      addr: "172.35.1.1:8076"
      htpasswd: "{{ rclone_serve_htpasswd_file }}"
      private-repos:
      append-only: