I have to manage some systems without root access, and our services are handled with init-style scripts with status/stop/start and so forth, but not managed with any of the common process management systems.
I would like to have Ansible manage these, but the service module currently does not accomodate such a situation. I can’t do anything about ensuring these processes run at boot, but being able to stop/start, ensure running/stopped in some manner would be nice.
I was considering using register variables in the following manner as a bit of a workaround.
- name: ensure service running
hosts: all
tasks:
- action: script /my/script status
register: service_status
- action: script /my/script start
only_if: "'${service_status.stdout}'.find('stopped') = -1"
Better ideas? I’d like to contribute and maybe modify the service module to acommodate scripts/binaries, but my skills are limited in this area.