--- - name: "[OpenRC] Enable and start service: synapse" service: name: synapse enabled: yes state: started when: - ansible_service_mgr == "openrc" - name: "[systemd] Enable and start service: synapse" systemd: name: synapse enabled: yes state: started when: - ansible_service_mgr == "systemd"