Reference · reference
service module (Windows)
use service manages Windows services through the Service Control Manager. It is Windows-only in this version: manage Linux services by running systemctl through the shell module. The module is registered on every platform so a playbook compiles and validates identically everywhere; on Linux and macOS every call returns a runtime error. Every function takes the service name and returns Result[…, string].
status
status
The current state of a service: running, stopped, start_pending, stop_pending, paused, pause_pending or continue_pending. A state the module does not recognise is reported as unknown.
start and stop
start
stop
Starts or stops a service. Each is a no-op when the service is already in the target state.
set_startup and startup
set_startup
startup
set_startup sets the startup type to automatic, manual or disabled. startup reads it back; a type outside those three is reported as other.
use service
use value
set_startup?
stop?
Ok
}