title: Nginx fails to restart via Ansible
body: <p>I have a task in a playbook that tries to restart nginx via a handler as per usual:</p>
  
  <pre><code>  name: restart nginx  
    service: name=nginx state=restarted
  </code></pre>
  
  <p>It gaves me this following error:</p>
  
  <pre><code>RUNNING HANDLER [webtier : restart nginx] **************************************
  fatal: [vagrant]: FAILED! =&gt; {"changed": false, "msg": "Unable to restart service nginx: Failed to restart nginx.service: Connection timed out\nSee system logs and 'systemctl status nginx.service' for details.\n"}
  </code></pre>
  
  <p>However until last time <strong>sudo: yes</strong> command was working. and the above error was not coming.</p>
  
  <p>But this time, by adding <strong>sudo: yes</strong> command</p>
  
  <pre><code>  name: restart nginx  
    service: name=nginx state=restarted
    sudo: yes 
  </code></pre>
  
  <p>Gives following error:</p>
  
  <pre><code>ERROR! conflicting action statements: service, sudo
  
  The error appears to be in '/Users/mac/Documents/GitHub/petalandstem/ansible/roles/webtier/handlers/main.yml': line 28, column 3, but may
  be elsewhere in the file depending on the exact syntax problem.
  
  The offending line appears to be:
  
  
  - name: restart nginx
    ^ here
  
  Ansible failed to complete successfully. Any error output should be
  visible above. Please fix these errors and try again.
  
  </code></pre>
  
  <p>How to restart nginx successfully ?</p>