sd_service
!sd_service
Category: services
Manage a systemd service’s enabled/started state via systemctl. Conflicts (started:false + restart:true) fail; restart without started implies start-if-stopped.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
service | string | yes | systemd unit name (e.g. nginx.service). |
enabled | bool | no | Desired enablement state (systemctl enable/disable). If omitted, left unchanged. |
started | bool | no | Desired running state (systemctl start/stop). If omitted with restart, restarts if running or starts if stopped. |
restart | bool | no | Restart the service if it is (or should be) running (systemctl restart). |
Examples
- !sd_service
service: nginx
enabled: true
started: true