title: stopping a service using ansible
body: <p>I am using ansible to test against a VM where I have already installed nginx.  I tried stopping the service using the command below and the resulting status displays that the process stopped.  However, on tha target server, I can see that the process is still running (and has been running for a few days).  I have the correct server in the ansible command
  and am checking the right server.  Any thoughts on why the command would display the status that the service has stopped even when it does not seem to have done so.  </p>
  
  <pre><code>ansible testserver -vvv -m service -a "name=nginx state=stopped"
  Using /home/test/devops/ansible.cfg as config file
  &lt;ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com&gt; ESTABLISH SSH CONNECTION FOR USER: test
  &lt;ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o Port=1234 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=test -o ConnectTimeout=10 -o ControlPath=/home/test/.ansible/cp/ansible-ssh-%h-%p-%r ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1467905869.39-108785461246651 `" &amp;&amp; echo ansible-tmp-1467905869.39-108785461246651="` echo $HOME/.ansible/tmp/ansible-tmp-1467905869.39-108785461246651 `" ) &amp;&amp; sleep 0'"'"''
  &lt;ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com&gt; PUT /tmp/tmpqpCm5g TO /home/ali/.ansible/tmp/ansible-tmp-1467905869.39-108785461246651/service
  &lt;ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o Port=1234 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ali -o ConnectTimeout=10 -o ControlPath=/home/test/.ansible/cp/ansible-ssh-%h-%p-%r '[ec2-52-87-166-241.compute-1.amazonaws.com]'
  &lt;ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com&gt; ESTABLISH SSH CONNECTION FOR USER: test
  &lt;ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o Port=1234 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ali -o ConnectTimeout=10 -o ControlPath=/home/ali/.ansible/cp/ansible-ssh-%h-%p-%r -tt ec2-xx.xxx.xxx.xxx.compute-1.amazonaws.com '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/test/.ansible/tmp/ansible-tmp-1467905869.39-108785461246651/service; rm -rf "/home/test/.ansible/tmp/ansible-tmp-1467905869.39-108785461246651/" &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'"'"''
  testserver | SUCCESS =&gt; {
      "changed": true, 
      "invocation": {
          "module_args": {
              "arguments": "", 
              "enabled": null, 
              "name": "nginx", 
              "pattern": null, 
              "runlevel": "default", 
              "sleep": null, 
              "state": "stopped"
          }, 
          "module_name": "service"
      }, 
      "name": "nginx", 
      "state": "stopped"
  }
  </code></pre>