diff --git a/hosts b/hosts index 31415d3..b3def02 100644 --- a/hosts +++ b/hosts @@ -3,3 +3,6 @@ bank-pi.bitlair.nl [mqtt_internal] mqtt.bitlair.nl + +[music] +music.bitlair.nl diff --git a/roles/music/handlers/main.yaml b/roles/music/handlers/main.yaml new file mode 100644 index 0000000..43f7a73 --- /dev/null +++ b/roles/music/handlers/main.yaml @@ -0,0 +1,17 @@ +--- +- name: reload nginx + systemd: + name: nginx + state: reloaded + +- name: rebuild trollibox + command: ./build.sh + args: + chdir: /opt/trollibox + environment: { RELEASE: 1 } + +- name: restart trollibox + systemd: + name: trollibox + state: restarted + daemon_reload: true diff --git a/roles/music/tasks/main.yaml b/roles/music/tasks/main.yaml new file mode 100644 index 0000000..73a6ac8 --- /dev/null +++ b/roles/music/tasks/main.yaml @@ -0,0 +1,3 @@ +--- +- tags: music_trollibox + include: trollibox.yaml diff --git a/roles/music/tasks/trollibox.yaml b/roles/music/tasks/trollibox.yaml new file mode 100644 index 0000000..1e094eb --- /dev/null +++ b/roles/music/tasks/trollibox.yaml @@ -0,0 +1,13 @@ +--- +- name: Clone trollibox source + git: + repo: https://github.com/polyfloyd/trollibox.git + version: master + dest: /opt/trollibox + accept_hostkey: yes + notify: + - rebuild trollibox + - restart trollibox + +- name: Initial build + meta: flush_handlers