music: Set up ampswitch for MPD and Librespot

This commit is contained in:
polyfloyd 2025-06-01 22:43:04 +02:00
parent 32b75696c2
commit c784d4d217
4 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,34 @@
---
- name: Install ampswitch depencies
apt:
name:
- libboost-dev
- libboost-dev
- nlohmann-json3-dev
- name: Install ampswitch service file
template:
src: ampswitch.service
dest: /etc/systemd/system/ampswitch-{{ item.instance }}.service
owner: root
group: root
mode: 0755
with_items:
- instance: mpd
pw_inputs:
- "Music Player Daemon:output_FL"
- "Music Player Daemon:output_FR"
- instance: librespot
pw_inputs:
- "librespot:out_0"
- "librespot:out_1"
notify: restart ampswitch
- name: Enable ampswitch
ansible.builtin.systemd:
name: "ampswitch-{{ item }}"
state: started
enabled: true
with_items:
- librespot
- mpd