Skip to content

Commit

Permalink
remote: fix cleanup when there are dots in the name of a remote
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Oct 2, 2024
1 parent 2543bf9 commit a342020
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions roles/remote/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
---
- name: "Cleanup | Set 'rclone_service_name'"
ansible.builtin.set_fact:
rclone_service_name: "{{ item.key.split('.')[0] }}"
rclone_service_name_full: "{{ item.key.split('.')[0] }}.service"
rclone_refresh_service_name: "{{ item.key.split('.')[0] }}_refresh.service"
rclone_service_name: "{{ item.key | regex_replace('\\.service$', '') }}"
rclone_service_name_full: "{{ item.key }}"
rclone_refresh_service_name: "{{ (item.key | regex_replace('\\.service$', '')) + '_refresh.service' }}"
rclone_service_status: "{{ item.value }}"

- name: "Cleanup | Fail if 'rclone_service_name' is empty"
Expand Down Expand Up @@ -59,7 +59,7 @@

- name: "Cleanup | Set 'cleanup_mount_path'"
ansible.builtin.set_fact:
cleanup_mount_path: "/mnt/remote/{{ item.key.split('.')[0].split('_')[-1] }}"
cleanup_mount_path: "/mnt/remote/{{ rclone_service_name | regex_replace('^' + rclone_service_template, '') }}"

- name: "Cleanup | Fail if 'cleanup_mount_path' is empty"
ansible.builtin.fail:
Expand Down

0 comments on commit a342020

Please sign in to comment.