music: Add new skipbutton service
This commit is contained in:
parent
84e3dc8478
commit
303e188e24
3 changed files with 49 additions and 0 deletions
|
@ -29,3 +29,9 @@
|
||||||
name: mpd-volume-to-mqtt
|
name: mpd-volume-to-mqtt
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
|
||||||
|
- name: restart skipbutton
|
||||||
|
systemd:
|
||||||
|
name: skipbutton
|
||||||
|
state: restarted
|
||||||
|
daemon_reload: true
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
name:
|
name:
|
||||||
- jackd
|
- jackd
|
||||||
- mpd
|
- mpd
|
||||||
|
- python3-mpd
|
||||||
|
- python3-serial
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install mpd-volume-to-mqtt script
|
- name: Install mpd-volume-to-mqtt script
|
||||||
|
@ -30,3 +32,27 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
daemon_reload: 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
|
||||||
|
|
17
roles/music/templates/skipbutton.service
Normal file
17
roles/music/templates/skipbutton.service
Normal 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
|
Loading…
Add table
Reference in a new issue