ansible / ansible.builtin / v2.9.27 / module / svc Manage daemontools services | "added in version" 1.9 of ansible.builtin" Authors: Brian Coca (@bcoca) stableinterface | supported by communityansible.builtin.svc (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Controls daemontools services on remote hosts using the svc utility.
- name: Start svc dnscache, if not running svc: name: dnscache state: started
- name: Stop svc dnscache, if running svc: name: dnscache state: stopped
- name: Kill svc dnscache, in all cases svc: name: dnscache state: killed
- name: Restart svc dnscache, in all cases svc: name: dnscache state: restarted
- name: Reload svc dnscache, in all cases svc: name: dnscache state: reloaded
- name: Using alternative svc directory location svc: name: dnscache state: reloaded service_dir: /var/service
name: description: - Name of the service to manage. required: true type: str state: choices: - killed - once - reloaded - restarted - started - stopped 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. type: str downed: 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. type: bool enabled: description: - Whether the service is enabled or not, if disabled it also implies stopped. Take note that a service can be enabled and downed (no auto restart). type: bool service_dir: default: /service description: - Directory svscan watches for services type: str service_src: default: /etc/service description: - Directory where services are defined, the source of symlinks to service_dir. type: str