84 lines
1.9 KiB
YAML
84 lines
1.9 KiB
YAML
---
|
|
- name: Install MPD
|
|
ansible.builtin.apt:
|
|
name: mpd
|
|
state: present
|
|
|
|
- name: Add mpd user to the {{ music_audio_group }} group
|
|
user:
|
|
name: mpd
|
|
groups:
|
|
- "{{ music_audio_group }}"
|
|
notify: restart mpd
|
|
|
|
- name: Install mpd file
|
|
ansible.builtin.template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart mpd
|
|
with_items:
|
|
- src: mpd.conf
|
|
dest: /etc/mpd.conf
|
|
- src: mpd.service
|
|
dest: /etc/systemd/system/mpd.service
|
|
- src: mpd_state
|
|
dest: /var/lib/mpd/state.default
|
|
|
|
- name: Install mpd-volume-to-mqtt script
|
|
ansible.builtin.template:
|
|
src: mpd-volume-to-mqtt.sh
|
|
dest: /opt/mpd-volume-to-mqtt.sh
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: Restart mpd-volume-to-mqtt
|
|
|
|
- name: Install mpd-volume-to-mqtt service
|
|
ansible.builtin.template:
|
|
src: mpd-volume-to-mqtt.service
|
|
dest: /etc/systemd/system/mpd-volume-to-mqtt.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: Restart mpd-volume-to-mqtt
|
|
|
|
- name: Enable mpd-volume-to-mqtt
|
|
ansible.builtin.systemd:
|
|
name: mpd-volume-to-mqtt
|
|
state: started
|
|
enabled: true
|
|
daemon_reload: true
|
|
|
|
- name: Install skipbutton depedencies
|
|
ansible.builtin.apt:
|
|
name:
|
|
- python3-mpd
|
|
- python3-serial
|
|
state: present
|
|
|
|
- name: Clone skipbutton source
|
|
ansible.builtin.git:
|
|
repo: https://github.com/bitlair/skipbutton.git
|
|
version: master
|
|
dest: /opt/skipbutton
|
|
accept_hostkey: yes
|
|
notify: Restart skipbutton
|
|
|
|
- name: Install skipbutton service
|
|
ansible.builtin.template:
|
|
src: skipbutton.service
|
|
dest: /etc/systemd/system/skipbutton.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: Restart skipbutton
|
|
|
|
- name: Enable skipbutton
|
|
ansible.builtin.systemd:
|
|
name: skipbutton
|
|
state: started
|
|
enabled: true
|
|
daemon_reload: true
|