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