windows_service
Experimental. A service that already exists on a Windows host: how it starts and whether it’s running. Removing the step leaves it as it is.
Experimental. Windows support is new, and this module may change between releases.
Use windows_service to say how an existing service starts and whether it’s running. Conn3x doesn’t create services here.
Example usage
Section titled “Example usage”step "web_running" { windows_service { name = "W3SVC" start_mode = "auto" state = "running" }}step "no_print_spooler" { windows_service { name = "Spooler" start_mode = "disabled" state = "stopped" }}Arguments
Section titled “Arguments”| Name | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Service name, not its display name, such as W3SVC. |
start_mode |
string | No | “auto”, “delayed”, “manual” or “disabled”. Left as it is when unset. |
state |
string | No | “running” or “stopped”. Left as it is when unset. |
Read-only attributes
Section titled “Read-only attributes”Conn3x sets these; reference them as conn3x_windows_service.<circuit>__<step>["<host>"].<name>.
| Name | Type | Description |
|---|---|---|
in_sync |
bool | Whether the service matched at the last refresh. |
revision |
string | Changes each time Conn3x changes this on the host. Handlers watch it. |
A step lowers to the conn3x_windows_service resource, one instance per host, and connects with its circuit’s ssh block.
How it works
Section titled “How it works”Use the service’s name, not its display name, which changes with the display language. Stopping a service that others depend on fails with Windows’ message: stop those first. A service that stops right after starting shows as an error at apply, not a success.
Be careful with sshd. Stopping or disabling it cuts Conn3x off from the host.
Removal
Section titled “Removal”Deleting a windows_service step leaves the service as it is.