ansible-role-navidrome/tasks/config.yml
Laur Ivan 9d870bb96d feat!: Refactor configuration
Docker-config is more flexible.
Configuration is more hierarchical (except paths).
2023-01-22 19:36:10 +01:00

46 lines
1.1 KiB
YAML

---
- name: "NAVIDROME | Set up directories"
ansible.builtin.file:
state: directory
path: "{{ item }}"
owner: "{{ ansible_effective_user_id }}"
group: "{{ ansible_effective_group_id }}"
mode: "0750"
with_items:
- "{{ navidrome_skeleton_paths }}"
tags:
- navidrome.configure
become: true
- name: "NAVIDROME | Write configuration files"
ansible.builtin.template:
src: "navidrome/{{ item }}.j2"
dest: "{{ navidrome_docker_path | expanduser | realpath }}/{{ item }}"
mode: '0640'
loop:
- "docker-compose.yml"
- "env.bonob.conf"
- "env.navidrome.conf"
tags:
- navidrome.configure
- name: "NAVIDROME | Check if the music volume exists"
ansible.builtin.stat:
path: "{{ navidrome_music_volume }}"
register: music
tags:
- navidrome.configure
- name: "NAVIDROME | 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:
- navidrome.configure
become: true
when: not music.stat.exists