Skip to content

Commit

Permalink
fix: only create remote_path if it's not /
Browse files Browse the repository at this point in the history
  • Loading branch information
tigattack authored and stefangweichinger committed Nov 15, 2024
1 parent 8f2c00c commit 1678c2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Note: This example assumes you have created the `rclone.service` systemd unit yo

This variable allows for the configuration of rclone mounts within your infrastructure. `rclone_mounts` should be a YAML list of objects, each including keys for `name`, `remote_name`, `remote_path`, `local_path`, `auto_mount`, and `extra_args`. This setup enables precise control over multiple mount points, their remote sources, and whether they should be automatically mounted.

The role will attempt to create all defined `remote_path`'s by default. You can disable this by setting `rclone_mkdir` to `false`.
The role will attempt to create all defined `remote_path`'s by default, **if** the `remote_path` is not simply `/`. You can disable this by setting `rclone_mkdir` to `false`.

If you use `rclone_mounts`, you must run this role as root using `become: true`.

Expand Down
4 changes: 3 additions & 1 deletion tasks/mount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
loop: "{{ rclone_mounts }}"
loop_control:
label: "{{ item.remote_name }}:{{ item.remote_path }}"
when: rclone_mkdir
when:
- rclone_mkdir
- item.remote_path != '/'
register: rclone_mkdir_output
changed_when: rclone_mkdir_output.rc == 0

Expand Down

0 comments on commit 1678c2b

Please sign in to comment.