music: Add soundboard
This commit is contained in:
parent
97a4e95ca8
commit
2e47c6744f
7 changed files with 141 additions and 0 deletions
|
@ -8,6 +8,9 @@
|
|||
- tags: music_librespot
|
||||
import_tasks: librespot.yaml
|
||||
|
||||
- tags: music_soundboard
|
||||
import_tasks: soundboard.yaml
|
||||
|
||||
- tags: music
|
||||
block:
|
||||
- name: Install nginx
|
||||
|
|
72
roles/music/tasks/soundboard.yaml
Normal file
72
roles/music/tasks/soundboard.yaml
Normal file
|
@ -0,0 +1,72 @@
|
|||
---
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name: virtualenv
|
||||
state: present
|
||||
|
||||
- name: Clone soundboard source
|
||||
git:
|
||||
repo: https://github.com/polyfloyd/mqtt-soundboard.git
|
||||
version: main
|
||||
dest: /opt/soundboard
|
||||
accept_hostkey: yes
|
||||
notify: restart soundboard
|
||||
|
||||
- name: Create virtualenv
|
||||
command: virtualenv /opt/soundboard/.venv
|
||||
args:
|
||||
creates: /opt/soundboard/.venv
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: . .venv/bin/activate && pip install -r requirements.txt
|
||||
args:
|
||||
chdir: /opt/soundboard
|
||||
|
||||
- name: Install soundboard config file
|
||||
template:
|
||||
src: soundboard.yaml
|
||||
dest: /etc/soundboard.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart soundboard
|
||||
|
||||
- name: Install soundboard service file
|
||||
template:
|
||||
src: soundboard.service
|
||||
dest: /etc/systemd/system/soundboard.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart soundboard
|
||||
|
||||
- name: Enable soundboard
|
||||
systemd:
|
||||
name: soundboard
|
||||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
|
||||
- name: Install shutdown sound script
|
||||
template:
|
||||
src: shutdown-sound.sh
|
||||
dest: /opt/shutdown-sound.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Install shutdown sound service
|
||||
template:
|
||||
src: shutdown-sound.service
|
||||
dest: /etc/systemd/system/shutdown-sound.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: daemon reload
|
||||
|
||||
- name: Enable shutdown-sound
|
||||
systemd:
|
||||
name: shutdown-sound
|
||||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
Loading…
Add table
Add a link
Reference in a new issue