Skip to content

Commit

Permalink
remote: always run remote role
Browse files Browse the repository at this point in the history
required to allow rclone service cleanup when disabling remotes entirely.
  • Loading branch information
saltydk committed Oct 3, 2023
1 parent 005a988 commit d60bfa9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions roles/remote/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- name: Import Rclone Role
ansible.builtin.include_role:
name: rclone
when: ('mounts' in ansible_run_tags) and remote_update_rclone
when: use_remote and ('mounts' in ansible_run_tags) and remote_update_rclone

- name: "Gather list of running Docker containers"
ansible.builtin.shell: "docker ps --format '{{ '{{' }} .Names{{ '}}' }}' --filter label=com.github.saltbox.saltbox_managed=true | xargs echo -n"
Expand Down Expand Up @@ -140,12 +140,15 @@
group: "{{ user.name }}"
mode: "0775"

- name: Remote Tasks
ansible.builtin.include_tasks: "remote.yml"
with_items: "{{ rclone.remotes }}"
when: rclone_remote_is_defined and item.template != "nfs"

- name: Remote Tasks (NFS)
ansible.builtin.include_tasks: "nfs.yml"
with_items: "{{ rclone.remotes }}"
when: rclone_remote_is_defined and item.template == "nfs"
- name: Remote Enabled Block
when: use_remote
block:
- name: Remote Tasks
ansible.builtin.include_tasks: "remote.yml"
with_items: "{{ rclone.remotes }}"
when: rclone_remote_is_defined and item.template != "nfs"

- name: Remote Tasks (NFS)
ansible.builtin.include_tasks: "nfs.yml"
with_items: "{{ rclone.remotes }}"
when: rclone_remote_is_defined and item.template == "nfs"
2 changes: 1 addition & 1 deletion saltbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- { role: system, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'system'] }
- { role: common, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'common'] }
- { role: motd, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'motd'] }
- { role: remote, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'mounts'], when: ['use_remote'] }
- { role: remote, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'mounts'] }
- { role: unionfs, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'mounts'] }
- { role: docker, tags: ['core', 'saltbox', 'mediabox', 'feederbox', 'docker', 'docker-filesystem-resize'] }
- { role: nvidia, tags: ['core', 'saltbox', 'mediabox', 'nvidia'], when: ['use_nvidia'] }
Expand Down

0 comments on commit d60bfa9

Please sign in to comment.