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