--- # "Does Navidrome actually answer", as opposed to infra/401's "is the unit # active". Navidrome can be perfectly `active` and serving 500s - a music # folder it cannot read does exactly that, and presents as an empty library. - name: Create the navidrome health check script ansible.builtin.template: src: healthcheck.sh.j2 dest: "{{ navidrome_healthcheck_script_path }}" owner: root group: root mode: '0755' validate: "bash -n %s" # 0600: carries the Gatus bearer token. - name: Create the navidrome health check systemd service ansible.builtin.template: src: healthcheck.service.j2 dest: "/etc/systemd/system/{{ navidrome_healthcheck_service_name }}.service" owner: root group: root mode: '0600' notify: Restart navidrome health check timer - name: Create the navidrome health check systemd timer ansible.builtin.template: src: healthcheck.timer.j2 dest: "/etc/systemd/system/{{ navidrome_healthcheck_service_name }}.timer" owner: root group: root mode: '0644' notify: Restart navidrome health check timer - name: Reload systemd daemon after health check units systemd: daemon_reload: yes # Ungated: enabling a timer is deployment, not monitoring. - name: Enable and restart the navidrome health check timer systemd: name: "{{ navidrome_healthcheck_service_name }}.timer" enabled: yes state: restarted daemon_reload: yes - name: Run the navidrome health check once to arm the timer ansible.builtin.command: "systemctl start {{ navidrome_healthcheck_service_name }}.service" changed_when: false