ivansible.lin_rclone

ivansible.lin_rclone

Github Test Status Ansible Galaxy

This tool helps you install rclone on a Linux system. It sets up a way to mount storage, configures remote connections, adds entries to fstab or systemd for automatic mounting, and creates a group for limited access to rclone configurations and mounts.

Requirements

None

Variables

Here are some options you can set, along with their default values.

  • lin_rclone_version: latest
  • lin_rclone_repo_owner: rclone
  • lin_rclone_upgrade: false

You can specify where to download rclone and whether to allow updates to the installed version.

  • lin_rclone_binary: /usr/bin/rclone
  • lin_rclone_config: /etc/rclone/rclone.conf

These are usually left as is.

  • lin_rclone_allow_nonroot: false
  • lin_rclone_group_gid: 911

Ansible will create a group called rclone with this ID. If allow_nonroot is set to true, users who are not root will get read access to rclone settings and mounts.

Other settings control specific options for mounting:

  • lin_rclone_idle_timeout: 900

  • lin_rclone_mount_timeout: 10

  • lin_rclone_vfs_cache_mode: writes

  • lin_rclone_dir_cache_time: 30s

  • lin_rclone_mount_verb: mount, cmount, mount2 or none

  • lin_rclone_bash_alias: true

This option creates a command shortcut rc in the user's profile.

  • lin_rclone_mounts: []

This is a list of mounts. Each mount has specific details explained below.

Mount Item

  • name: remote

The required name of the remote storage.

  • path: /mnt/remote

This is where the storage will be mounted. It's required even if mount is set to no.

  • enabled: true

This optional setting defaults to true. If set to false, Ansible will skip this mount.

  • config: | type = ... token = [TOKEN]

This is the plain-text configuration to be added for the remote. The token will be replaced with the actual authorization for this remote.

  • token: '{json...}'

This optional string contains the authorization for this remote in JSON format. Wrap it in single quotes to avoid issues.

  • reuse_token: false

This can be true, false, an empty string, or the name of a section in the config. When false, it only uses the token specified above. If true, it checks for a previous token in the config.

  • mount: true

When true, this mount will be added to fstab or systemd. If false, it will be removed if found.

  • systemd:

If true, a systemd unit will be created; if false, an entry will be added to fstab.

  • automount: false

If true, the systemd automounter will be enabled for this entry.

  • nonroot: false

This allows non-root users read-only access to the mount if set to true.

  • bglog: false

If true, a debugging log will be written to /tmp.

  • proxy: proto://host:port

This optional setting configures a proxy.

Tags

  • lin_rclone_install — installs rclone
  • lin_rclone_wrapper — creates a fuse wrapper for mounting
  • lin_rclone_config — configures remote storage
  • lin_rclone_mounts — sets up fstab/systemd entries and automounting
  • lin_rclone_bashrc — creates a bash alias for rclone
  • lin_rclone_docker_plugin — sets up the rclone docker plugin
  • lin_rclone_all — all of the above

Dependencies

This role uses the reload systemd daemon handler from the ivansible.lin_base role.

Example Playbook

- hosts: mystorage
  roles:
    - role: ivansible.lin_rclone
      lin_rclone_allow_nonroot: true
      lin_rclone_mounts:
        - name: box
          path: /mnt/box
          token: "my_box_token"
          reuse_token: another_box_section  # (or just true)
          automount: true
          nonroot: true
          config: |
            type = box
            token = [TOKEN]

License

MIT

Author Information

Created by IvanSible between 2019-2021.

Informazioni sul progetto

install rclone on linux and create mounts

Installa
ansible-galaxy install ivansible.lin_rclone
Licenza
Unknown
Download
163
Proprietario
ivandeex ansible roles, molecule tests: https://galaxy.ansible.com/ivansible/