diff --git a/README.md b/README.md index 0a00200..ef8c48c 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,9 @@ 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. -If you use this variable, you must run this role as root using `become: true`. +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`. #### Detailed example for `rclone_mounts` diff --git a/tasks/mount.yml b/tasks/mount.yml index 9db9bc6..d8773a7 100644 --- a/tasks/mount.yml +++ b/tasks/mount.yml @@ -4,7 +4,11 @@ ansible.builtin.command: cmd: "rclone mkdir '{{ item.remote_name }}':{{ item.remote_path }}" loop: "{{ rclone_mounts }}" - when: rclone_mkdir + loop_control: + label: "{{ item.remote_name }}:{{ item.remote_path }}" + when: + - rclone_mkdir + - item.remote_path != '/' register: rclone_mkdir_output changed_when: rclone_mkdir_output.rc == 0 @@ -28,6 +32,8 @@ group: root mode: '0644' loop: "{{ rclone_mounts }}" + loop_control: + label: "{{ item.name }}" when: item.remote_path is defined and item.local_path is defined notify: "Reload and restart rclone-mount services" @@ -46,4 +52,6 @@ enabled: yes state: restarted loop: "{{ found_services.files }}" + loop_control: + label: "{{ item.path | basename }}" notify: Reload and restart rclone-mount services