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