tigattack.rclone_rc_remotes

Ansible Role: rclone_rc_remotes

Build Status Ansible Galaxy

This Ansible role helps you create and remove Rclone remotes using Rclone's rc API.

To install the role, run: ansible-galaxy role install tigattack.rclone_rc_remotes

Requirements

No special requirements.

Dependencies

No dependencies.

Role Variables

  • rclone_host: The hostname or IP address for Rclone rc. It defaults to {{ ansible_fqdn }}.
  • rclone_port: The port for Rclone rc. Defaults to 5572, which is the standard port.
  • rclone_username: The username for Rclone rc.
  • rclone_password: The password for Rclone rc.
  • rclone_remotes: A list of Rclone remotes you want to create/remove.
  • remove_undefined_remotes: If set to true, any Rclone remotes not listed in rclone_remotes will be removed. Defaults to false.

Example of rclone_remotes Configuration

Here's an example based on a simple Google Drive remote setup:

rclone_remotes:
  - name: my-remote
    type: drive
    parameters:
      scope: drive
      client_id: "01234"
      client_secret: "56789"
      root_folder_id: "abcde"

Rclone Remote Authentication

Certain remote types, particularly those needing OAuth, require manual authentication.

In these cases, Ansible will provide instructions and pause until you finish the authentication process, at which point you can continue execution.

Example Playbook

Here’s how you might use this role in a playbook:

- hosts: all
  roles:
    - role: tigattack.rclone_rc_remotes
      vars:
        rclone_remotes:
          - name: my-remote
            type: drive
            parameters:
              scope: drive
              client_id: "01234"
              client_secret: "56789"
              root_folder_id: "abcde"

Using the Role for Authentication

Although the main purpose of the role is not authentication, one of the task files can help authenticate existing remotes if needed:

- name: Configure rclone remote
  ansible.builtin.include_role:
    name: tigattack.rclone_rc_remotes
    tasks_from: rclone-authenticate-remote.yml
  vars:
    remote_name: my-remote

Testing Note

This role does not have automatic tests, as it would need a working Rclone remote.

If you have suggestions for testing without using a real service, please share your ideas!

Informazioni sul progetto

Create and remove Rclone remotes via Rclone's rc API.

Installa
ansible-galaxy install tigattack.rclone_rc_remotes
Licenza
mit
Download
19.7k
Proprietario