--- - name: "[OpenRC] Start and enable service: frpc" service: name: frpc state: started enabled: yes when: - ansible_service_mgr == "openrc" - name: "[systemd] Start and enable service: frpc" systemd: name: frpc state: started enabled: yes when: - ansible_service_mgr == "systemd"