ivansible.lin_rclone
ivansible.lin_rclone
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
: latestlin_rclone_repo_owner
: rclonelin_rclone_upgrade
: false
You can specify where to download rclone and whether to allow updates to the installed version.
lin_rclone_binary
: /usr/bin/rclonelin_rclone_config
: /etc/rclone/rclone.conf
These are usually left as is.
lin_rclone_allow_nonroot
: falselin_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
: 900lin_rclone_mount_timeout
: 10lin_rclone_vfs_cache_mode
: writeslin_rclone_dir_cache_time
: 30slin_rclone_mount_verb
: mount, cmount, mount2 or nonelin_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 rclonelin_rclone_wrapper
— creates a fuse wrapper for mountinglin_rclone_config
— configures remote storagelin_rclone_mounts
— sets up fstab/systemd entries and automountinglin_rclone_bashrc
— creates a bash alias for rclonelin_rclone_docker_plugin
— sets up the rclone docker pluginlin_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.
install rclone on linux and create mounts
ansible-galaxy install ivansible.lin_rclone