Hi Team,
Am automating my TIbco EMS restart service using Ansible. I have tried to execute the shell script from the server where ansible installed and also remote server but the service is not coming up also not getting any error, the same script execution was successful if run shell script in both Remote and Ansible server. Please help.
My Play book.
---
- hosts: all
remote_user: tibco
tasks:
- name: Start the EMS services
script: TibemsStatus.sh {{emsserver}} {{actions}}
register: startemsoutput
- debug:
var: startemsoutput.stdout_lines
My Shell script
case "$2" in
start)
if [ $PID ]; then
echo "ems is already running for config file $conf_file. Check process id $PID";
else
echo "Starting tibems daemon for config file $conf_file."
# cd $TIBEMS_ROOT && ./tibemsd64 -config $conf_file > /dev/null 2>&1 &
(/opt/tibco/ems/8.3/bin/tibemsd64 -config $conf_file > /dev/null 2>&1 &) && exit
sleep 5
PROCESS_PID;
if [ $PID ]; then
echo "Done. Started ./tibemsd64 -config $conf_file The process id is [ $PID ]"
else
echo "Could not start ./tibemsd64 on this box for config $conf_file"
fi
fi
Regards,
Makesh.