Compare commits

..

No commits in common. "main" and "1.0.1" have entirely different histories.
main ... 1.0.1

15 changed files with 134 additions and 195 deletions

View File

@ -1 +0,0 @@
bonob.enabled: "true"

17
.gitignore vendored
View File

@ -1,14 +1,7 @@
tests/playbook.retry *.retry
tests/.cache */__pycache__
__pycache__ *.pyc
.pytest_cache
.molecule
.cache .cache
.venv .venv
.env.yml
*.iml docker-compose.yml
.idea
.project
*.pyc
**/.vscode

View File

@ -1,21 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.0.1](https://git.laurivan.com/Dev/ansible-role-navidrome/compare/v2.0.0...v2.0.1) (2023-01-24)
### Bug Fixes
* Make docker prefix be same as app. ([beddb48](https://git.laurivan.com/Dev/ansible-role-navidrome/commit/beddb48581242279c5c567edb7b695f0b3cdb5e4))
## 2.0.0 (2023-01-22)
### ⚠ BREAKING CHANGES
* Refactor configuration
### Features
* Refactor configuration ([9d870bb](https://git.laurivan.com/Dev/ansible-role-navidrome/commit/9d870bb96dac32ed76a5143b6af5bbf7f8a50c38))

View File

@ -15,64 +15,64 @@ All variables are listed below (see also `defaults/main.yml`).
You can (and should) specify the version of the navidrome image: You can (and should) specify the version of the navidrome image:
```yaml ```yaml
navidrome.image_version: 'latest' navidrome_image_version: 'latest'
``` ```
Navidrome needs a place to store its configuration and another to pick up music from: Navidrome needs a place to store its configuration and another to pick up music from:
```yaml ```yaml
navidrome.config_volume: '/mnt/config-local/navidrome' navidrome_config_volume: '/mnt/config-local/navidrome'
navidrome.music_volume: '/mnt/music' navidrome_music_volume: '/mnt/music'
``` ```
If you have multiple folders with music, you should create a parent and build symbolic links to them. If you have multiple folders with music, you should create a parent and build symbolic links to them.
The web interface is available at the following port: The web interface is available at the following port:
```yaml ```yaml
navidrome.host_port: 48533 navidrome_host_port: 48533
``` ```
### Bonob ### Bonob
If you have e.g. a Sonos system in the house, you may install also Bonob by setting `bonob.enabled` to `true`. the default is: If you have e.g. a Sonos system in the house, you may install also Bonob by setting `bonob_enabled` to `true`. the default is:
```yml ```yml
bonob.enabled: false bonob_enabled: false
``` ```
You can also specify the bonob image version and the port at which is available: You can also specify the bonob image version and the port at which is available:
```yml ```yml
bonob.image_version: 'latest' bonob_image_version: 'latest'
bonob.host_port: 48534 bonob_host_port: 48534
``` ```
You can change the colors of the bonob icon displayed: You can change the colors of the bonob icon displayed:
```yml ```yml
bonob.icon_color: "beige" bonob_icon_color: "beige"
bonob.icon_background: "red" bonob_icon_background: "red"
``` ```
#### Sonos #### Sonos
The sonos-related variables are: The sonos-related variables are:
```yml ```yml
bonob.sonos.auto_register: 'true' bonob_sonos_auto_register: 'true'
bonob.sonos.device_discovery: 'true' bonob_sonos_device_discovery: 'true'
bonob.sonos.seed_host: bonob_sonos_seed_host:
bonob.sonos.service_id: "246" bonob_sonos_service_id: "246"
``` ```
If you try sonos autodiscovery and it doesn't work, please: If you try sonos autodiscovery and it doesn't work, please:
1. Find the IP of one of the Sonos devices 1. Find the IP of one of the Sonos devices
2. Set `bonob.sonos.seed_host` to that IP 2. Set `bonob_sonos_seed_host` to that IP
3. Replay the role 3. Replay the role
You can also add custom clients for streaming: You can also add custom clients for streaming:
```yaml ```yaml
bonob.subsonic.custom_clients: 'audio/flac' bonob_subsonic_custom_clients: 'audio/flac'
``` ```
For more details, please see the [Bonob documentation](https://github.com/simojenki/bonob). For more details, please see the [Bonob documentation](https://github.com/simojenki/bonob).
@ -97,7 +97,7 @@ A list of other roles hosted on Galaxy should go here, plus any details in regar
- name: Example playbook - name: Example playbook
hosts: services hosts: services
vars: vars:
bonob.enabled: "true" bonob_enabled: "true"
roles: roles:
- 'laurivan.navidrome' - 'laurivan.navidrome'

View File

@ -1,36 +1,27 @@
--- ---
# defaults file for navidrome # defaults file for navidrome
navidrome_root_path: /var/local navidrome_image_version: 'latest'
navidrome_config_volume: "{{ navidrome_root_path }}/config/navidrome"
navidrome_docker_path: "{{ navidrome_root_path }}/docker/navidrome" navidrome_config_volume: '/mnt/config-local/navidrome'
navidrome_music_volume: '/mnt/music' navidrome_music_volume: '/mnt/music'
navidrome_skeleton_paths:
- "{{ navidrome_docker_path }}" navidrome_host_port: 48533
- "{{ navidrome_config_volume }}"
timezone: 'Europe/Brussels' timezone: 'Europe/Brussels'
navidrome:
image_version: 'latest'
host_port: 48533
# Bonob # Bonob
bonob: bonob_enabled: false
enabled: false bonob_image_version: 'latest'
image_version: 'latest' bonob_host_port: 48534
host_port: 48534 bonob_icon_color: "beige"
icon_color: "beige" bonob_icon_background: "red"
icon_background: "red"
## Bonob sonos settings ## Bonob sonos settings
sonos: bonob_sonos_auto_register: 'true'
auto_register: 'true' bonob_sonos_device_discovery: 'true'
device_discovery: 'true' bonob_sonos_seed_host:
seed_host: bonob_sonos_service_id: "246"
service_id: "246"
## Subsonic ## Subsonic
subsonic: bonob_subsonic_custom_clients: 'audio/flac'
custom_clients: 'audio/flac'

View File

@ -1,46 +0,0 @@
---
- 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

View File

@ -1,9 +0,0 @@
---
# Deploy navidrome
- name: "NAVIFROME | Ensure navirdome is running"
community.docker.docker_compose:
project_src: "{{ navidrome_docker_path | expanduser | realpath }}"
build: false
become: false

View File

@ -1,11 +1,54 @@
--- ---
# tasks file for navidrome
- name: "NAVIDROME | Configure" - name: Set up directories
import_tasks: config.yml ansible.builtin.file:
state: directory
path: "{{ item }}"
owner: "{{ ansible_effective_user_id }}"
group: "{{ ansible_effective_group_id }}"
mode: "0750"
with_items:
- "{{ navidrome_config_volume }}"
- "~/navidrome"
tags: tags:
- navidrome.configure - configuration
become: true
- name: "NAVIDROME | Install" - name: Check if the music volume exists
import_tasks: install.yml ansible.builtin.stat:
path: "{{ navidrome_music_volume }}"
register: music
tags: tags:
- navidrome.install - 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"
dest: "~/navidrome/{{ item }}"
mode: '0640'
loop:
- "docker-compose.yml"
- "env.navidrome.conf"
- "env.bonob.conf"
tags:
- configuration
- name: Ensure navirdome is running.
community.docker.docker_compose:
project_src: ~/navidrome/
build: false
become: false

View File

@ -0,0 +1,31 @@
version: "3.3"
services:
navidrome:
image: "deluan/navidrome:{{ navidrome_image_version }}"
restart: always
env_file:
- ~/navidrome/env.navidrome.conf
volumes:
- {{ navidrome_config_volume }}:/data
- {{ navidrome_music_volume }}:/music
ports:
- {{ navidrome_host_port }}:4533
networks:
- navidrome
{% if bonob_enabled %}
bonob:
image: simojenki/bonob:{{ bonob_image_version }}
restart: always
depends_on:
- navidrome
env_file:
- ~/navidrome/env.bonob.conf
ports:
- "{{ bonob_host_port }}:3000"
networks:
- navidrome
- default
{% endif %}
networks:
navidrome: {}

View File

@ -0,0 +1,15 @@
{% if bonob_enabled %}
BNB_SONOS_AUTO_REGISTER={{ bonob_sonos_auto_register }}
BNB_SONOS_DEVICE_DISCOVERY={{ bonob_sonos_device_discovery }}
BNB_PORT=3000
{% if bonob_sonos_seed_host %}
BNB_SONOS_SEED_HOST={{ bonob_sonos_seed_host }}
{% endif %}
BNB_SUBSONIC_URL=http://navidrome:4533
BNB_SONOS_SERVICE_ID={{ bonob_sonos_service_id }}
BNB_URL=http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ bonob_host_port }}
BNB_SUBSONIC_CUSTOM_CLIENTS="audio/flac"
BNB_ICON_FOREGROUND_COLOR={{ bonob_icon_color }}
BNB_ICON_BACKGROUND_COLOR={{ bonob_icon_background }}
TZ={{ timezone }}
{% endif %}

View File

@ -0,0 +1 @@
TZ={{timezone}}

View File

@ -1,32 +0,0 @@
version: "3.3"
services:
navidrome:
image: "deluan/navidrome:{{ navidrome.image_version }}"
restart: always
env_file:
- "{{ navidrome_docker_path | expanduser | realpath }}/env.navidrome.conf"
volumes:
- {{ navidrome_config_volume }}:/data
- {{ navidrome_music_volume }}:/music:ro
ports:
- {{ navidrome.host_port }}:4533
networks:
- navidrome
{% if bonob.enabled %}
bonob:
image: simojenki/bonob:{{ bonob.image_version }}
restart: always
depends_on:
- navidrome
env_file:
- "{{ navidrome_docker_path | expanduser | realpath }}/env.bonob.conf"
ports:
- "{{ bonob.host_port }}:3000"
networks:
- navidrome
- default
{% endif %}
networks:
navidrome: {}

View File

@ -1,15 +0,0 @@
{% if bonob.enabled %}
BNB_SONOS_AUTO_REGISTER={{ bonob.sonos.auto_register }}
BNB_SONOS_DEVICE_DISCOVERY={{ bonob.sonos.device_discovery }}
BNB_PORT=3000
{% if bonob.sonos.seed_host %}
BNB_SONOS_SEED_HOST={{ bonob.sonos.seed_host }}
{% endif %}
BNB_SUBSONIC_URL=http://navidrome:4533
BNB_SONOS_SERVICE_ID={{ bonob.sonos.service_id }}
BNB_URL=http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ bonob.host_port }}
BNB_SUBSONIC_CUSTOM_CLIENTS="audio/flac"
BNB_ICON_FOREGROUND_COLOR={{ bonob.icon_color }}
BNB_ICON_BACKGROUND_COLOR={{ bonob.icon_background }}
TZ={{ timezone }}
{% endif %}

View File

@ -1,5 +0,0 @@
TZ={{timezone}}
ND_ENABLETRANSCODINGCONFIG=true
ND_SCANSCHEDULE=1h
ND_LOGLEVEL=info
ND_SESSIONTIMEOUT=24h

View File

@ -1,6 +0,0 @@
ansible==5.2.0
molecule==3.4.0
docker==5.0.0
molecule-docker==0.2.4
ansible-lint==5.3.2
yamllint==1.28.0