Remote jboss startup script failing in Ansible

788 views
Skip to first unread message

Surya

unread,
May 31, 2017, 6:53:31 PM5/31/17
to Ansible Project
HI Team,

I have the Jboss startup script to be triggered by Ansible for my BAU activities. 

startup script starts: Host controller, Process controller, and Server groups. When i run the script locally, its working fine, But when i trigger it from Ansible its not starting the instances. 

Play book step as below:-

- hosts: uat_hosts
  become: yes
  become_user: jboss

  tasks:

  - name: stop the Host controller and server group
    shell: "/home/jboss/bin/stopApplePAY-JVM.sh"
    tags: stop-hc-jvm

  - name: start the Host controller and server group
    shell: "nohup /home/jboss/bin/startApplePAY-HC.sh 1>/dev/null 2>&1"
    tags: start-hc-jvm

Note:- Playbook execution is successful, But its not starting the instances, I have tired adding sleep in the startup script, but did not help. Tried async option in the Play book, no luck.


Startup script as below:-

$cat startApplePAY-HC.sh

/opt/applepayuat-jboss6/jboss-eap-6.2/bin/domain.sh -P file:///apps/applepay-jboss6/jboss-eap-6.2/domain/configuration/domain.properties >/dev/null 2>&1 &

Note:- The above script will start totally 6 Jboss java process. 


Please some one help if you fix for this. Thank you ..!

Tnx
Surya

Dick Visser

unread,
Jun 1, 2017, 5:59:46 AM6/1/17
to ansible...@googlegroups.com
Start with removing the redirection to /dev/null so you can see what's happening.

Dick  
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f42e547e-e281-4d5e-b41f-f2087988ef8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

Surya

unread,
Jun 7, 2017, 6:53:19 PM6/7/17
to Ansible Project
Hi Dick,

I tried with that, just the command is getting executed but in remote machine the instances are not started.. any option i can try, Please advice.

Dick Visser

unread,
Jun 8, 2017, 5:54:59 AM6/8/17
to ansible...@googlegroups.com
Use enough verbosity (-vvvv).
If that doesn't work, try redirecting your shell script output to a
file instead of /dev/null.
Since your main shell script run another shell script, you can try
adjusting the verbosity of that as well.

Dick
> https://groups.google.com/d/msgid/ansible-project/16f7c4ed-c938-4bc6-a6bd-f793316caa41%40googlegroups.com.

Surya

unread,
Jun 8, 2017, 2:17:07 PM6/8/17
to Ansible Project
Hi Dick,

Have resolved the issue, just added "sleep 200" in the end of my startup script. So Ansible will wait 200 sec to terminate the ssh session. I could see my jboss instances are started and running fine.

Thanks for your time and suggestions ..! Appreciate it .
Reply all
Reply to author
Forward
0 new messages