diff --git a/playbooks/mpdb.yaml b/playbooks/mpdb.yaml index b1fb746..5389ddb 100644 --- a/playbooks/mpdb.yaml +++ b/playbooks/mpdb.yaml @@ -51,6 +51,8 @@ mode: 0644 owner: root group: root + notify: + - Restart MPD - name: mpdf music directory file: path: "/var/lib/mpd/music" @@ -58,13 +60,18 @@ owner: root group: root mode: '0755' + notify: + - Restart MPD + - name: setup service on hosts template: src: mpdb.service.j2 dest: "/usr/lib/systemd/system/mpd.service" mode: 0644 owner: root - group: root + group: root + notify: + - Restart MPD - name: mpd service start systemd: name: "mpd" @@ -72,5 +79,8 @@ enabled: yes masked: no daemon_reload: yes - - + handlers: + - name: Restart MPD + ansible.builtin.service: + name: mpd + state: restarted diff --git a/playbooks/mpdf.yaml b/playbooks/mpdf.yaml index 8464d7f..37043ce 100644 --- a/playbooks/mpdf.yaml +++ b/playbooks/mpdf.yaml @@ -57,6 +57,8 @@ mode: 0644 owner: root group: root + notify: + - Restart MPD loop: "{{ range(1,mpdcount|int + 1) }}" - name: mpdf var directory file: @@ -65,6 +67,8 @@ owner: root group: root mode: '0777' + notify: + - Restart MPD loop: "{{ range(1,mpdcount|int + 1) }}" - name: mpdf playlist directory file: @@ -73,6 +77,8 @@ owner: root group: root mode: '0755' + notify: + - Restart MPD loop: "{{ range(1,mpdcount|int + 1) }}" # - name: mpdf pid file # file: @@ -89,6 +95,8 @@ owner: root group: root mode: '0755' + notify: + - Restart MPD loop: "{{ range(1,mpdcount|int + 1) }}" - name: copy sticker.sql copy: @@ -97,6 +105,8 @@ owner: root group: root mode: '0644' + notify: + - Restart MPD loop: "{{ range(1,mpdcount|int + 1) }}" - name: setup service on hosts template: @@ -106,6 +116,8 @@ owner: root group: root loop: "{{ range(1,mpdcount|int + 1) }}" + notify: + - Restart MPD - name: mpd service start systemd: name: "mpdf{{ item }}" @@ -115,4 +127,8 @@ daemon_reload: yes loop: "{{ range(1,mpdcount|int + 1) }}" - + handlers: + - name: Restart MPD + ansible.builtin.service: + name: mpd + state: restarted