The very last line of that script is to tail the log file forever.  As
such, the script never finishes.

Looking at the script, I'm questioning why you wouldn't turn it into a
playbook and individual tasks instead of running that script.

On Wed, Mar 9, 2022 at 8:22 AM rahul raviz <[email protected]> wrote:

> I am writing a task in a playbook which will execute a shell script on a
> remote server. But for some reason it never exits and hangs and then
> finally times out. When I run the script directly on the remote server,
> there are no errors. Here is the snippet of the task.
>
>  - name: Run a script
>     shell: sh /tmp/setup.sh
>     become: yes
>
>
> The shell script setup.sh is below. What can I do to fix this?
> =================================================
> #!/bin/bash -x
>
> ORACLE_HOME=/usr/lib/oracle/12.1/client64
> LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/
> LIBRARY_PATH=$ORACLE_HOME/lib
> PERL5OPT="-I/usr/local/lib64/perl5/DBD/
> -I/usr/share/perl5/vendor_perl/CGI/ -I/usr/lib64/perl5/Sys/
> -I/usr/share/perl5/vendor_perl/"
>
> cd /apps/bx/zabbbx_scripts/DBD-Oracle-1.76
> perl Makefile.PL && make && make install
>
>
> cp /apps/bx/application/config/appdescriptor.xml
> /apps/bx/config/appdescriptor.xml.$date; mv
> /apps/bx/application/config/appdescriptor.xml
> /apps/bx/config/appdescriptor.xml; cd /apps/bx/application/config; ln -s
> /apps/bx/config/appdescriptor.xml appdescriptor.xml
> chown -R azasx:azasx /apps/bx/application/config/
> chown -R azasx:azasx /apps/bx/config/
>
> chmod 755 /etc/zabbbx_agentd.conf
> chmod -R 755 /usr/local/lib64/perl5/
> chmod 755 /apps/bx/config/appdescriptor.xml
> #timedatectl set-timezone America/Chicago
>
>
>
> mkdir -p
> /apps/ix/log/zabbix_scripts/monitoring/application_processes/processes_info_zabbix/processes_info_zabbix
> touch
> /apps/ix/log/zabbix_scripts/monitoring/application_processes/processes_info_zabbix/processes_info_zabbix/processes_info_zabbix
> chown zabbix:azasx
> /apps/ix/log/zabbix_scripts/monitoring/application_processes/processes_info_zabbix/processes_info_zabbix/processes_info_zabbix
>
> #Sysop Server:
> mkdir -p
> /apps/ix/log/zabbix_scripts/monitoring/mq_queues/queues_info_zabbix
>
> chmod -R 755 /apps/ix/log/zabbix_scripts/monitoring
>
> #Continue for all node types:
> cd /apps/ix/log
> chown -R zabbix:azasx zabbix_scripts/
> #For LOG: chown -R zabbix:zabbix zabbix_scripts/
> chmod -R 775 zabbix_scripts/
>
> cd /apps/ix
> mkdir monitoring
> chown zabbix:zabbix -R monitoring/
>
>
> #As root:
> service zabbix-agent start && tail -F /var/log/zabbix/zabbix_agentd.log
> ==========================================================
>
>
> --
> 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/585c680c-b3ad-418d-bc77-1981908cd99cn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/585c680c-b3ad-418d-bc77-1981908cd99cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v97FOtmsobLeiZ4o%2BD2Le8XqbA%3Dx-VtoHn9j21ZZz54Cg%40mail.gmail.com.

Reply via email to