Documentation
PLEASE NOTE: This document applies to latest version and not to the latest stable release v2.21
Documentation for other releases can be found by using the version selector in the top right of any doc page.runit
Manage Runit services.
Attributes
check_mode:
support: full
Parameters
| Parameter | Required | Type | Values | Description |
|---|---|---|---|---|
| name | true | string | Name of the service to manage. | |
| state | string | reloaded restarted started stopped |
Whether the service should be started, stopped, restarted, or reloaded. | |
| enabled | boolean | Whether the service should be enabled at boot. [default: true] |
||
| service_dir | string | Runit service directory where service definitions are stored. [default: /etc/sv] |
Example
- name: Start nginx under runit
runit:
name: nginx
state: started
enabled: true
- name: Stop nginx service
runit:
name: nginx
state: stopped
- name: Restart nginx service
runit:
name: nginx
state: restarted
- name: Reload nginx service
runit:
name: nginx
state: reloaded
- name: Enable nginx at boot
runit:
name: nginx
enabled: true
- name: Disable nginx at boot
runit:
name: nginx
enabled: false
- name: Use custom service directory
runit:
name: nginx
state: started
service_dir: /etc/sv