tigattack.rclone_rc_remotes

Ansible角色:rclone_rc_remotes

构建状态 Ansible Galaxy

Ansible角色,用于通过Rclone的rc API创建和移除Rclone远程。

安装角色:ansible-galaxy role install tigattack.rclone_rc_remotes

需求

无。

依赖

无。

角色变量

  • rclone_host:Rclone rc主机名或IP地址。默认为{{ ansible_fqdn }}
  • rclone_port:Rclone rc端口。默认为5572,即rc的默认端口。
  • rclone_username:Rclone rc用户名。
  • rclone_password:Rclone rc密码。
  • rclone_remotes:Rclone远程的列表(数组)。
  • remove_undefined_remotes:如果为true,则会移除在rclone_remotes变量中未定义的所有Rclone远程。默认为false

rclone_remotes示例,基于简单的Google Drive远程配置:

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

Rclone远程认证

某些后端(远程)类型,例如需要OAuth的类型,要求互动认证,因此无法完全自动化。

在这种情况下,Ansible将提示您一些说明,暂停执行,并确保在完成互动认证并恢复执行后可以连接到远程。

示例剧本

- 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"

使用无需rclone rc的远程认证

虽然这不是该角色的主要用途,但可以使用任务文件来认证现有的远程,如果需要认证,如下所示:

- name: 配置rclone远程
  ansible.builtin.include_role:
    name: tigattack.rclone_rc_remotes
    tasks_from: rclone-authenticate-remote.yml
  vars:
    remote_name: my-remote

测试说明

此角色未自动测试,因为需要定义一个可用于Rclone的远程。

如果您有任何想法,请随时建议一种无需依赖现实世界服务的方式来进行测试。

关于项目

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

安装
ansible-galaxy install tigattack.rclone_rc_remotes
许可证
mit
下载
19.7k
拥有者