<p dir="auto">Hi,</p>
<p dir="auto">After I've upgraded ansible to ansible 1.9.0.1, i've got a problem with ask_sudo_password.<br>
(server asks for sudo password)</p>
<p dir="auto">(ansible runs on arch linux, the target system is CentOS6)<br>
With earlier versions of ansible (1.8.2, 1.8.4) runs fine</p>
<p dir="auto">My settings:<br>
sudo_user      = root<br>
sudo           = True</p>
<h1 dir="auto">ask_sudo_pass = True</h1>
<p dir="auto">become=False</p>
<h1 dir="auto">become_method='sudo'</h1>
<p dir="auto">become_user=''</p>
<h1 dir="auto">become_ask_pass=False</h1>
<p dir="auto">(to fix problem in issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="64550171" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/10547" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/10547/hovercard" href="https://github.com/ansible/ansible/issues/10547">#10547</a>)</p>
<p dir="auto">In playbook:<br>
...<br>
sudo: True<br>
...</p>
<p dir="auto">and the command:<br>
ansible -m setup  -K<br>
SUDO password:<br>
xxxxxx server xxxxxx | FAILED =&gt; ssh connection closed waiting for a privilege escalation password prompt</p>
<p dir="auto">Issue Type:</p>
<p dir="auto">Bug</p>
<p dir="auto">Ansible Version:  1.9.0.1 from ppa stable.</p>
<p dir="auto">Environment:</p>
<p dir="auto">Linux Ubuntu 12.04 host to Linux Debian wheezy target.</p>
<p dir="auto">Summary:</p>
<p dir="auto">playbook roles are not executed as sudo anymore.</p>
<p dir="auto">Steps To Reproduce:</p>
<p dir="auto">consider the following playbook working with 1.7.2 but no more working with the 1.9.0.1:</p>
<p dir="auto">test.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: test
  roles:
    - role: addgroups
      sudo: yes"><pre class="notranslate"><code class="notranslate">- hosts: test
  roles:
    - role: addgroups
      sudo: yes
</code></pre></div>
<p dir="auto">roles/addgroups/tasks/main.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- name: add toto group
  group: name=toto state=present"><pre class="notranslate"><code class="notranslate">
---
- name: add toto group
  group: name=toto state=present
</code></pre></div>
<p dir="auto">Expected Results:</p>
<p dir="auto">add the test group without any failure.</p>
<p dir="auto">Actual Results:</p>
<p dir="auto">failed: [zoo] =&gt; {"failed": true, "name": "test"}<br>
msg: groupadd: Permission denied.<br>
groupadd: cannot lock /etc/group; try again later</p>
<p dir="auto">digging into the verbose mode we can observe that the addgroups role is still called with sudo with older version i.e. 1.7.2 and not any more called with sudo with 1.9.0.1</p>
<p dir="auto">1.7.2</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="u'/bin/sh -c \'sudo -k &amp;&amp; sudo -H -S -p &quot;[sudo via ansible, key=hgpjwxwhvkcrvjywzmwiwhxnnamxrfln] password: &quot; -u root /bin/sh -c \'&quot;\'&quot;\'echo SUDO-SUCCESS-hgpjwxwhvkcrvjywzmwiwhxnnamxrfln; LANG=C LC_CTYPE=C /usr/bin/python /home/test/.ansible/tmp/ansible-tmp-1427390484.81-80330223816703/group\'&quot;"><pre class="notranslate"><code class="notranslate">u'/bin/sh -c \'sudo -k &amp;&amp; sudo -H -S -p "[sudo via ansible, key=hgpjwxwhvkcrvjywzmwiwhxnnamxrfln] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-hgpjwxwhvkcrvjywzmwiwhxnnamxrfln; LANG=C LC_CTYPE=C /usr/bin/python /home/test/.ansible/tmp/ansible-tmp-1427390484.81-80330223816703/group\'"
</code></pre></div>
<p dir="auto">1.9.0.1</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/test/.ansible/tmp/ansible-tmp-1427392790.43-74683051810820/group"><pre class="notranslate"><code class="notranslate">/bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/test/.ansible/tmp/ansible-tmp-1427392790.43-74683051810820/group
</code></pre></div>
<p dir="auto">Cheers</p>