title: Ansible non-root sudo user and "become" privilege escalation
body: <p>I've set up a box with a user <code>david</code> who has sudo privileges. I can ssh into the box and perform sudo operations like <code>apt-get install</code>. When I try to do the same thing using Ansible's "become privilege escalation", I get a <code>permission denied</code> error. So a simple playbook might look like this:</p>
  
  <p><code>simple_playbook.yml:</code></p>
  
  <pre><code>---
  - name: Testing...
    hosts: all
    become: true
    become_user: david
    become_method: sudo
  
    tasks:
      - name: Just want to install sqlite3 for example...
        apt: name=sqlite3 state=present
  </code></pre>
  
  <p>I run this playbook with the following command:</p>
  
  <pre><code>ansible-playbook -i inventory simple_playbook.yml --ask-become-pass
  </code></pre>
  
  <p>This gives me a prompt for a password, which I give, and I get the following error (abbreviated):</p>
  
  <pre><code>fatal: [123.45.67.89]: FAILED! =&gt; {...
  failed: E: Could not open lock file /var/lib/dpkg/lock - open (13: 
  Permission denied)\nE: Unable to lock the administration directory
  (/var/lib/dpkg/), are you root?\n", ...}
  </code></pre>
  
  <p>Why am I getting permission denied?</p>
  
  <p><strong>Additional information</strong></p>
  
  <p>I'm running Ansible 2.1.1.0 and am targeting a Ubuntu 16.04 box. If I use <code>remote_user</code> and <code>sudo</code> options as per Ansible &lt; v1.9, it works fine, like this:
  <code>
  remote_user: david
  sudo: yes
  </code></p>
  
  <p><strong>Update</strong></p>
  
  <p>The local and remote usernames are the same. To get this working, I just needed to specify <code>become: yes</code> (see @techraf's answer):</p>