Add beets to navidrome role
This commit is contained in:
parent
219cfb6e78
commit
0c9429d6d8
@ -1,15 +1,37 @@
|
|||||||
|
- name: Install necessary packages for beets
|
||||||
|
community.general.pacman:
|
||||||
|
name:
|
||||||
|
- beets
|
||||||
|
- python-pylast
|
||||||
|
- python-httpx
|
||||||
|
- yt-dlp
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Create Navidrome user
|
- name: Create Navidrome user
|
||||||
user:
|
user:
|
||||||
name: navidrome
|
name: navidrome
|
||||||
home: "{{ dataroot }}/navidrome"
|
home: "{{ dataroot }}/navidrome"
|
||||||
create_home: no
|
create_home: no
|
||||||
|
|
||||||
- name: Deploy SSH key for Navidrome user
|
- name: Ensure .config exists
|
||||||
ansible.posix.authorized_key:
|
file:
|
||||||
user: navidrome
|
path: "/home/{{ username }}/.config/"
|
||||||
state: present
|
state: directory
|
||||||
key: "{{ lookup('file', '~/.ssh/keys/{{ inventory_hostname }}_navidrome.pub')}}"
|
owner: "{{ username }}"
|
||||||
ignore_errors: yes
|
group: "{{ username }}"
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Ensure beets configuration folder exists
|
||||||
|
file:
|
||||||
|
path: "/home/{{ username }}/.config/beets/"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ username }}"
|
||||||
|
group: "{{ username }}"
|
||||||
|
|
||||||
|
- name: Deploy beets configuration file
|
||||||
|
template:
|
||||||
|
src: beets_config.yaml.j2
|
||||||
|
dest: "/home/{{ username }}/.config/beets/config.yaml"
|
||||||
|
|
||||||
- name: Install Navidrome AUR package
|
- name: Install Navidrome AUR package
|
||||||
kewlfft.aur.aur:
|
kewlfft.aur.aur:
|
||||||
@ -17,12 +39,24 @@
|
|||||||
state: present
|
state: present
|
||||||
become_user: aur-build
|
become_user: aur-build
|
||||||
|
|
||||||
- name: Ensure Navidrome directory is under right owner
|
- name: Create music group
|
||||||
|
group:
|
||||||
|
name: mus
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add user to music group
|
||||||
|
user:
|
||||||
|
name: "{{ username }}"
|
||||||
|
append: yes
|
||||||
|
groups: mus
|
||||||
|
|
||||||
|
- name: Set Navidrome directory permissions
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
path: "{{ dataroot }}/navidrome"
|
path: "{{ dataroot }}/navidrome"
|
||||||
owner: navidrome
|
owner: navidrome
|
||||||
group: navidrome
|
group: mus
|
||||||
|
mode: u=rwX,g=rwX,o=-rwx
|
||||||
recurse: yes
|
recurse: yes
|
||||||
|
|
||||||
- name: Set Navidrome working directory
|
- name: Set Navidrome working directory
|
||||||
|
8
roles/services/navidrome/templates/beets_config.yaml.j2
Normal file
8
roles/services/navidrome/templates/beets_config.yaml.j2
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
directory: {{ dataroot }}/navidrome/mus
|
||||||
|
library: {{ dataroot }}/navidrome/beetslib.db
|
||||||
|
|
||||||
|
plugins: fetchart lastgenre
|
||||||
|
|
||||||
|
lastgenre:
|
||||||
|
auto: yes
|
||||||
|
canonical: yes
|
Reference in New Issue
Block a user