music: Extend Trollibox installation
This commit is contained in:
parent
f8dd32b234
commit
7356db2b8a
5 changed files with 46 additions and 0 deletions
1
roles/music/defaults/main.yaml
Normal file
1
roles/music/defaults/main.yaml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
music_audio_user: audio
|
|
@ -1,3 +1,6 @@
|
||||||
---
|
---
|
||||||
|
- tags: music_mpd
|
||||||
|
include_tasks: mpd.yaml
|
||||||
|
|
||||||
- tags: music_trollibox
|
- tags: music_trollibox
|
||||||
include_tasks: trollibox.yaml
|
include_tasks: trollibox.yaml
|
||||||
|
|
7
roles/music/tasks/mpd.yaml
Normal file
7
roles/music/tasks/mpd.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
- name: Install MPD
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- jackd
|
||||||
|
- mpd
|
||||||
|
state: present
|
|
@ -11,3 +11,19 @@
|
||||||
|
|
||||||
- name: Initial build
|
- name: Initial build
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
|
- name: Install service file
|
||||||
|
template:
|
||||||
|
src: trollibox.service
|
||||||
|
dest: /etc/systemd/system/trollibox.service
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
notify: restart trollibox
|
||||||
|
|
||||||
|
- name: Enable Trollibox
|
||||||
|
systemd:
|
||||||
|
name: trollibox
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
daemon_reload: true
|
||||||
|
|
19
roles/music/templates/trollibox.service
Normal file
19
roles/music/templates/trollibox.service
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#
|
||||||
|
# Managed by Ansible
|
||||||
|
#
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Trollibox
|
||||||
|
After=mpd.service network.target
|
||||||
|
Requires=mpd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
RestartSec=2s
|
||||||
|
ExecStart=/opt/trollibox/bin/trollibox -conf /etc/trollibox.yaml
|
||||||
|
User={{ music_audio_user }}
|
||||||
|
Group={{ music_audio_user }}
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Add table
Reference in a new issue