50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
---
|
|
- name: Install dependencies
|
|
ansible.builtin.apt:
|
|
name: virtualenv
|
|
state: present
|
|
|
|
- name: Clone soundboard source
|
|
ansible.builtin.git:
|
|
repo: https://github.com/polyfloyd/mqtt-soundboard.git
|
|
version: main
|
|
dest: /opt/soundboard
|
|
accept_hostkey: yes
|
|
notify: restart soundboard
|
|
|
|
- name: Create virtualenv
|
|
ansible.builtin.command:
|
|
cmd: virtualenv /opt/soundboard/.venv
|
|
args:
|
|
creates: /opt/soundboard/.venv
|
|
|
|
- name: Install Python dependencies
|
|
ansible.builtin.shell:
|
|
cmd: . .venv/bin/activate && pip install -r requirements.txt
|
|
args:
|
|
chdir: /opt/soundboard
|
|
|
|
- name: Install soundboard config file
|
|
ansible.builtin.template:
|
|
src: soundboard.yaml
|
|
dest: /etc/soundboard.yaml
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart soundboard
|
|
|
|
- name: Install soundboard service file
|
|
ansible.builtin.template:
|
|
src: soundboard.service
|
|
dest: /etc/systemd/system/soundboard.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart soundboard
|
|
|
|
- name: Enable soundboard
|
|
ansible.builtin.systemd:
|
|
name: soundboard
|
|
state: started
|
|
enabled: true
|
|
daemon_reload: true
|