Ansible Fails to Restart Jetty on a remote host

Hi All,

I’m trying to restart jetty using an ansible script

bellow is a snippet from my script

`

probably because you have sh on the command. Probably better if you pass the whole directory to jetty.sh restart. Like /apps/servers/jetty/bin/jetty.sh restart

i think it is because the process is started within the ssh session opened by ansible, and if you close the session, the subprocesses will be stopped as well.

2 solutions:

  1. use a system-service to restart jetty (don’t know if it exists; maybe jetty.sh is doing this already, then the solution from jonathan would solve it))
  2. use nohup at beginning of the command, to start the process outside of your ssh-session.

regards,
andre