--- - name: "[OpenRC] Restart service: prometheus (to deploy config changes)" service: name: prometheus state: restarted when: - ansible_service_mgr == "openrc" listen: "Restart prometheus" - name: "[systemd] Restart service: prometheus (to deploy config changes)" systemd: name: prometheus state: restarted when: - ansible_service_mgr == "systemd" listen: "Restart prometheus"