From cf0ba963e82df4e29b948418d7bcb25a2ca284a8 Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Mon, 26 Sep 2022 15:33:55 +0200 Subject: [PATCH] Create also the music volume if it doesn't exist. --- tasks/main.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index a52a158..69c174b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,6 +15,26 @@ - configuration become: true +- name: Check if the music volume exists + ansible.builtin.stat: + path: "{{ navidrome_music_volume }}" + register: music + tags: + - configuration + +- name: Set up music volume + ansible.builtin.file: + state: directory + path: "{{ navidrome_music_volume }}" + owner: "{{ ansible_effective_user_id }}" + group: "{{ ansible_effective_group_id }}" + mode: "0750" + tags: + - configuration + become: true + when: not music.stat.exists + + - name: Write configuration files ansible.builtin.template: src: "{{ item }}.j2"