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

Am Mittwoch, 25. September 2019 15:58:24 UTC+2 schrieb Madushan Chathuranga:
>
> Hi All,
>
> I'm trying to restart jetty using an ansible script
>
> bellow is a snippet from my script
>
> ---
>   - hosts: all
>     tasks:
>
>
>      - name: start jetty
>        command: sh jetty.sh restart
>        args:
>          chdir: /apps/servers/jetty/bin
>
> my inventory file is 
> 10.0.18.225 ansible_user=appusr ansible_ssh_private_key_file=/home/ec2-
> user/key
>
>
> What happens is ansible is able to restart the jetty server as expected. 
> but once ansible script done it's execution jetty server stops.
> Any Ideas why this would happen. I don't have the luxury to start jetty as 
> a service here 'jetty start'. There are no error or sigkills in the jetty 
> logs. ansible also shows Jetty Start : OK in it's stdrr output. Would be 
> great if anyone could help me with this.
>
> Thanks.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7c1830af-89b7-481d-a465-059c5542e7d3%40googlegroups.com.

Reply via email to