view /declarative/systemd
Systemd unit
Modules / systemd
Converge active and enabled state, with deferred handlers.
YAML example
- name: Keep nginx active
systemd:
unit: nginx.service
state: started
enabled: trueSchema fields
| Field | Type | Required | Constraint |
|---|---|---|---|
unit | string | yes | Explicit systemd unit name. |
state | string | — | Desired active state.started | stopped |
enabled | boolean | — | Desired boot enablement. |
notify | array | — | Handler names notified after a verified change. |