From 1678c2b1f59d3f79f92ac1d876937196379d94cc Mon Sep 17 00:00:00 2001 From: tigattack <10629864+tigattack@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:49:01 +0100 Subject: [PATCH] fix: only create `remote_path` if it's not `/` --- README.md | 2 +- tasks/mount.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 85f75f4..ef8c48c 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/tasks/mount.yml b/tasks/mount.yml index 09aef40..d8773a7 100644 --- a/tasks/mount.yml +++ b/tasks/mount.yml @@ -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