Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.runit.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| enabled boolean |
| Whether the service is enabled or not, if disabled it also implies stopped. |
| name string / required | Name of the service to manage. | |
| service_dir string | Default: "/var/service" | directory runsv watches for services |
| service_src string | Default: "/etc/sv" | directory where services are defined, the source of symlinks to service_dir. |
| state string |
| started/stopped are idempotent actions that will not run commands unless necessary. restarted will always bounce the service (sv restart) and killed will always bounce the service (sv force-stop). reloaded will send a HUP (sv reload). once will run a normally downed sv once (sv once), not really an idempotent operation. |
- 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
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/runit_module.html