From 7f2e74490dcd200b5794785e0e2395efd9b247a0 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Tue, 26 Sep 2023 18:43:51 -0400 Subject: [PATCH] roles/containers: make navidrome dir have the 'vault' group --- roles/containers/tasks/main.yml | 39 +++++++++++-------- .../templates/docker-compose.yml.j2 | 1 + 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/roles/containers/tasks/main.yml b/roles/containers/tasks/main.yml index fc55e87..e7b3ca6 100644 --- a/roles/containers/tasks/main.yml +++ b/roles/containers/tasks/main.yml @@ -17,23 +17,6 @@ register: user_gitea when: '"gitea" in groups' -- name: Create Navidrome user - user: - name: navidrome - register: user_navidrome - when: '"navidrome" in groups' - -- name: Create Navidrome directories - file: - path: "{{ item }}" - state: directory - owner: navidrome - group: navidrome - mode: "u=rwX,g=rwX,o=" - with_items: - - "{{ music_path }}" - - "{{ dataroot }}/navidrome" - - name: Create Syncthing group group: name: vault @@ -73,6 +56,28 @@ groups: vault when: '"syncthing" in groups' +- name: Create Navidrome user + user: + name: navidrome + register: user_navidrome + when: '"navidrome" in groups' + +- name: Create Navidrome directory + file: + path: "{{ dataroot }}/navidrome" + state: directory + owner: navidrome + group: navidrome + mode: "u=rwX,g=rwX,o=" + +- name: Create music directory + file: + path: "{{ music_path }}" + state: directory + owner: navidrome + group: vault + mode: "u=rwX,g=rwX,o=" + - name: Create docker-compose directory ansible.builtin.file: path: "{{ docker_compose_dir }}" diff --git a/roles/containers/templates/docker-compose.yml.j2 b/roles/containers/templates/docker-compose.yml.j2 index caa3d57..4cbb9dd 100644 --- a/roles/containers/templates/docker-compose.yml.j2 +++ b/roles/containers/templates/docker-compose.yml.j2 @@ -46,6 +46,7 @@ services: - {{ vault_path }}/:/vault - {{ archive_path }}/:/vault_a - {{ syncthing_conf_dir }}/:/var/syncthing/config + - "{{ music_path }}:/music" {% endif %} {% if "navidrome" in group_names %}