ansible.builtin.runit (v2.4.2.0-1) — module

Manage runit services.

| "added in version" 2.3 of ansible.builtin"

Authors: James Sumners (@jsumners)

stableinterface | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.2.0.post1

Description

Controls runit services on remote hosts using the sv utility.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to start sv dnscache, if not running
 - runit:
    name: dnscache
    state: started
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to stop sv dnscache, if running
 - runit:
    name: dnscache
    state: stopped
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to kill sv dnscache, in all cases
 - runit:
    name: dnscache
    state: killed
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to restart sv dnscache, in all cases
 - runit:
    name: dnscache
    state: restarted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to reload sv dnscache, in all cases
 - runit:
    name: dnscache
    state: reloaded
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example using alt sv directory location
 - runit:
    name: dnscache
    state: reloaded
    service_dir: /run/service

Inputs

    
name:
    description:
    - Name of the service to manage.
    required: true

state:
    choices:
    - started
    - stopped
    - restarted
    - killed
    - reloaded
    - once
    description:
    - C(started)/C(stopped) are idempotent actions that will not run commands unless necessary.  C(restarted)
      will always bounce the service (sv restart) and C(killed) will always bounce the
      service (sv force-stop). C(reloaded) will send a HUP (sv reload). C(once) will run
      a normally downed sv once (sv once), not really an idempotent operation.
    required: false

enabled:
    choices:
    - 'yes'
    - 'no'
    description:
    - Wheater the service is enabled or not, if disabled it also implies stopped.
    required: false

service_dir:
    default: /var/service
    description:
    - directory runsv watches for services
    required: false

service_src:
    default: /etc/sv
    description:
    - directory where services are defined, the source of symlinks to service_dir.
    required: false