ansible-nas/roles/navidrome/tasks/main.yml
Dylan Lathrum 0dbffe9f44 Add Navidrome
Navidrome is an open source web-based music collection server and streamer that is compatible with Subsonic/Airsonic. It gives you freedom to listen to your music collection from any browser or mobile device. It's like your personal Spotify!
2022-05-27 15:43:21 -07:00

35 lines
1.3 KiB
YAML

---
- name: Create Navidrome Directories
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ navidrome_data_directory }}/data"
- "{{ navidrome_data_directory }}/playlists"
- name: Navidrome Docker Container
docker_container:
name: navidrome
image: deluan/navidrome:latest
pull: true
volumes:
- "{{ navidrome_data_directory }}/data:/navidrome/data:rw"
- "{{ navidrome_music_directory }}:/navidrome/music:rw"
ports:
- "{{ navidrome_port }}:4533"
env:
ND_MUSICFOLDER: "/navidrome/music"
ND_DATAFOLDER: "/navidrome/data"
ND_SCANSCHEDULE: "{{ navidrome_scan_schedule }}"
ND_LOGLEVEL: "{{ navidrome_log_level }}"
ND_SESSIONTIMEOUT: "{{ navidrome_session_timeout }}"
restart_policy: unless-stopped
memory: "{{ navidrome_memory }}"
labels:
traefik.enable: "{{ navidrome_available_externally }}"
traefik.http.routers.navidrome.rule: "Host(`{{ navidrome_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.navidrome.tls.certresolver: "letsencrypt"
traefik.http.routers.navidrome.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.navidrome.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.navidrome.loadbalancer.server.port: "4533"