I originally had:
service:
name: kannel
state: restarted
but sometimes, for a unknown reason, it does not restart one of the processes in the service "smsbox", so I have to use shell module:
- name: restart kannel
shell: |
service kannel stop
pkill -9 smsbox
service kannel start
Is this the best that I can do? Is there a way to ensure all processes stopped and restarted with the service
module of Ansible or the service
command?