ansible.builtin.svc (v2.4.6.0-1) — module

Manage daemontools services.

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

Authors: Brian Coca (@bcoca)

stableinterface | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

Controls daemontools services on remote hosts using the svc utility.

Usage examples

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

Inputs

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

state:
    choices:
    - started
    - stopped
    - restarted
    - reloaded
    - once
    - killed
    description:
    - C(Started)/C(stopped) are idempotent actions that will not run commands unless necessary.  C(restarted)
      will always bounce the svc (svc -t) and C(killed) will always bounce the svc (svc
      -k). C(reloaded) will send a sigusr1 (svc -1). C(once) will run a normally downed
      svc once (svc -o), not really an idempotent operation.
    required: false

downed:
    choices:
    - 'yes'
    - 'no'
    default: false
    description:
    - Should a 'down' file exist or not, if it exists it disables auto startup. defaults
      to no. Downed does not imply stopped.
    required: false

enabled:
    choices:
    - 'yes'
    - 'no'
    description:
    - Wheater the service is enabled or not, if disabled it also implies stopped. Make
      note that a service can be enabled and downed (no auto restart).
    required: false

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

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