Ansible Command, Shell modules not executing script
<p>I have a tomcat.sh with its intended purpose to restart (stop and start) the tomcat after it has been deployed onto the remote host. </p>

<p>I noticed that the Shell and Command modules is not executing the .sh file. However, I am able to execute the .sh file manually on the remote host as the the remote user.</p>

<p>The Playbook tasks are listed below:</p>

<p><strong>Shell</strong></p>

<pre><code>- name: ensures tomcat is restarted
  shell:
   "nohup {{tomcat_dir}}/apache-tomcat-{{tomcat_version}}/tomcat.sh &amp;"
</code></pre>

<p><strong>Command</strong></p>

<pre><code>- name: ensures tomcat is restarted test-test
  command: ./tomcat.sh
  args:
    chdir: "{{tomcat_dir}}/apache-tomcat-{{tomcat_version}}"
</code></pre>