--- - name: Create forgejo-runner systemd service ansible.builtin.template: src: forgejo-runner.service.j2 dest: /etc/systemd/system/forgejo-runner.service owner: root group: root mode: '0644' notify: Restart forgejo-runner - name: Reload systemd systemd: daemon_reload: yes - name: Enable and start forgejo-runner service systemd: name: forgejo-runner enabled: yes state: started # Before the assert below, not at the end of the play. A config change queues a # restart; if that restart ran after the verification, the play would assert # that the OLD process is healthy and then replace it unverified. - name: Apply a pending restart before checking the runner ansible.builtin.meta: flush_handlers - name: Verify forgejo-runner is active command: systemctl is-active forgejo-runner register: runner_active changed_when: false # Ungated on purpose. This was previously guarded by `uptime_kuma_enabled`, but # it is not a monitoring task — it is the deployment asserting its own success. # The deprecation banner swept it up along with the Kuma plumbing, which meant a # broken runner deployed "successfully" and silently. - name: Assert runner is running assert: that: - runner_active.stdout == "active" fail_msg: "forgejo-runner service is not active: {{ runner_active.stdout }}"