Remote jboss startup script failing in Ansible

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

Start with removing the redirection to /dev/null so you can see what’s happening.

Dick

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.

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

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 .