title: Can't run sudo command in Ansible playbook
body: <p>I am writing an Ansible playbook to automate a series of sudo commands on various hosts. When I execute these commands individually in puTTY, I have no permission problems, as I have been granted proper access. However, when I attempt to create a playbook to do the same thing, I am told</p>
  
  <blockquote>
    <p>user is not allowed to execute ... on host_name</p>
  </blockquote>
  
  <p>For example, if I do <code>$ sudo ls /root/</code>, I have no problem, and, once I enter my password, can see the contents of /root/</p>
  
  <p>In the case of my Ansible playbook ...</p>
  
  <pre><code>---
  - host: servers
    tasks:
    - name: ls /root/
      shell: ls /root/
      become: true
      become_method: sudo
  </code></pre>
  
  <p>...I then get the error mentioned above. </p>
  
  <p>Any ideas why this would be the case? It seems to be telling me I don't have permission to run a command that I otherwise could run in an individual puTTY terminal.</p>