Ansible 2.1.0 using become/become_user fails to set permissions on temp file
<p>I have an ansible 2.1.0 on my server, where I do deployment via <strong>vagrant</strong> and on PC too.
The role "deploy" have :</p>

<pre><code>- name: upload code
  become: true
  become_user: www-data
  git: repo=git@bitbucket.org:****.git
     dest=/var/www/main
     key_file=/var/www/.ssh/id_rsa
     accept_hostkey=true
     update=yes
     force=yes
 register: fresh_code
 notify: restart php-fpm
 tags: fresh_code
</code></pre>

<p>In this case with ansible 2.1.0 I get an error:</p>

<pre><code>fatal: [default]: FAILED! =&gt; {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}
</code></pre>

<p>It it ansible 2.0.1.0 which I use on my PC, is all normally - folder /var/www/ have folder main with owner and group www-data</p>

<p>If I use only became_user: www-data and if I use become_method: sudo with became_user: www-data - i got same error</p>

<p>What need to do to resolve this?</p>