music: Add new skipbutton service

This commit is contained in:
polyfloyd 2024-04-14 22:35:09 +02:00
parent 84e3dc8478
commit 303e188e24
3 changed files with 49 additions and 0 deletions

View file

@ -29,3 +29,9 @@
name: mpd-volume-to-mqtt
state: restarted
daemon_reload: true
- name: restart skipbutton
systemd:
name: skipbutton
state: restarted
daemon_reload: true

View file

@ -4,6 +4,8 @@
name:
- jackd
- mpd
- python3-mpd
- python3-serial
state: present
- name: Install mpd-volume-to-mqtt script
@ -30,3 +32,27 @@
state: started
enabled: true
daemon_reload: true
- name: Clone skipbutton source
git:
repo: https://github.com/bitlair/skipbutton.git
version: master
dest: /opt/skipbutton
accept_hostkey: yes
notify: restart skipbutton
- name: Install skipbutton service
template:
src: skipbutton.service
dest: /etc/systemd/system/skipbutton.service
owner: root
group: root
mode: 0644
notify: restart skipbutton
- name: Enable skipbutton
systemd:
name: skipbutton
state: started
enabled: true
daemon_reload: true

View file

@ -0,0 +1,17 @@
# {{ ansible_managed }}
[Unit]
Description=MPD Skipbutton
After=network.target
Requires=mpd.service
[Service]
Type=simple
Restart=always
RestartSec=10s
ExecStart=/opt/skipbutton/skipbutton.py /dev/ttyS0
DynamicUser=true
Group=dialout
[Install]
WantedBy=multi-user.target