community.general.runit module – Manage runit services
Note
This module is part of the community.general collection (version 4.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.runit
.
Parameters
Parameter |
Comments |
---|---|
Whether the service is enabled or not, if disabled it also implies stopped. Choices:
|
|
Name of the service to manage. |
|
directory runsv watches for services Default: “/var/service” |
|
directory where services are defined, the source of symlinks to service_dir. Default: “/etc/sv” |
|
Choices:
|
Examples
- name: Start sv dnscache, if not running
community.general.runit:
name: dnscache
state: started
- name: Stop sv dnscache, if running
community.general.runit:
name: dnscache
state: stopped
- name: Kill sv dnscache, in all cases
community.general.runit:
name: dnscache
state: killed
- name: Restart sv dnscache, in all cases
community.general.runit:
name: dnscache
state: restarted
- name: Reload sv dnscache, in all cases
community.general.runit:
name: dnscache
state: reloaded
- name: Use alternative sv directory location
community.general.runit:
name: dnscache
state: reloaded
service_dir: /run/service
Authors
James Sumners (@jsumners)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication