Documentation

runit - Manage runit services.

New in version 2.3.

Synopsis

  • Controls runit services on remote hosts using the sv utility.

Options

parameter required default choices comments
enabled
no
  • yes
  • no
Wheater the service is enabled or not, if disabled it also implies stopped.
name
yes
Name of the service to manage.
service_dir
no /var/service
directory runsv watches for services
service_src
no /etc/sv
directory where services are defined, the source of symlinks to service_dir.
state
no
  • started
  • stopped
  • restarted
  • killed
  • reloaded
  • once
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.

Examples

# Example action to start sv dnscache, if not running
 - sv:
    name: dnscache
    state: started

# Example action to stop sv dnscache, if running
 - sv:
    name: dnscache
    state: stopped

# Example action to kill sv dnscache, in all cases
 - sv:
    name: dnscache
    state: killed

# Example action to restart sv dnscache, in all cases
 - sv:
    name: dnscache
    state: restarted

# Example action to reload sv dnscache, in all cases
 - sv:
    name: dnscache
    state: reloaded

# Example using alt sv directory location
 - sv:
    name: dnscache
    state: reloaded
    service_dir: /run/service

Status

This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.