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?