<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">become_method: su</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
  config file = /home/user/testing/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
  config file = /home/user/testing/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[defaults]
hostfile = inventory
legacy_playbook_variables = false
nocows = 1
retry_files_enabled = false"><pre class="notranslate"><code class="notranslate">[defaults]
hostfile = inventory
legacy_playbook_variables = false
nocows = 1
retry_files_enabled = false
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">Become method SU times out, rendering it unusable. Tested on multiple operating systems, all with the prompt "Password: "</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible testboxen --become-method=su -b -K -a whoami"><pre class="notranslate"><code class="notranslate">ansible testboxen --become-method=su -b -K -a whoami
</code></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">su to correctly authenticate as root, and return root from whoami</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="testboxen | FAILED | rc=-1 &gt;&gt;
Timeout (12s) waiting for privilege escalation prompt: 
"><pre class="notranslate"><code class="notranslate">testboxen | FAILED | rc=-1 &gt;&gt;
Timeout (12s) waiting for privilege escalation prompt: 

</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">win_user</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible --version
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.6.6 (r266:84292, Aug 18 2016, 12:06:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]"><pre class="notranslate"><code class="notranslate">$ ansible --version
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.6.6 (r266:84292, Aug 18 2016, 12:06:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">n/a</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Running on Centos 7, managing Windows Server 2016</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">win_user can create a user, but running task again in playbook results in error</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">A minimal playbook</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
# vim: set filetype=ansible ff=unix ts=2 sw=2 ai expandtab :
#
# Playbook to configure the environment

- hosts: createuser
  tasks:
    - name: create user
      run_once: true
      win_user:
        name: gary
        password: 'B0bP4ssw0rd123!^'
        password_never_expires: true
        account_disabled: no
        account_locked: no
        password_expired: no
        state: present
        groups:
          - Administrators
          - Users"><pre class="notranslate">---
<span class="pl-c"><span class="pl-c">#</span> vim: set filetype=ansible ff=unix ts=2 sw=2 ai expandtab :</span>
<span class="pl-c"><span class="pl-c">#</span></span>
<span class="pl-c"><span class="pl-c">#</span> Playbook to configure the environment</span>

- <span class="pl-ent">hosts</span>: <span class="pl-s">createuser</span>
  <span class="pl-ent">tasks</span>:
    - <span class="pl-ent">name</span>: <span class="pl-s">create user</span>
      <span class="pl-ent">run_once</span>: <span class="pl-c1">true</span>
      <span class="pl-ent">win_user</span>:
        <span class="pl-ent">name</span>: <span class="pl-s">gary</span>
        <span class="pl-ent">password</span>: <span class="pl-s"><span class="pl-pds">'</span>B0bP4ssw0rd123!^<span class="pl-pds">'</span></span>
        <span class="pl-ent">password_never_expires</span>: <span class="pl-c1">true</span>
        <span class="pl-ent">account_disabled</span>: <span class="pl-s">no</span>
        <span class="pl-ent">account_locked</span>: <span class="pl-s">no</span>
        <span class="pl-ent">password_expired</span>: <span class="pl-s">no</span>
        <span class="pl-ent">state</span>: <span class="pl-s">present</span>
        <span class="pl-ent">groups</span>:
          - <span class="pl-s">Administrators</span>
          - <span class="pl-s">Users</span></pre></div>
<p dir="auto">When I run first time I get:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="PLAY [createuser] ************************

TASK [Gathering Facts] *******************
ok: [dsy-demo-mssql02]

TASK [create user] ***********************
changed: [dsy-demo-mssql02]

PLAY RECAP *******************************
dsy-demo-mssql02           : ok=2    changed=1    unreachable=0    failed=0
"><pre class="notranslate"><span class="pl-v">PLAY</span> [<span class="pl-s1">createuser</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span>

<span class="pl-v">TASK</span> [<span class="pl-v">Gathering</span> <span class="pl-v">Facts</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">ok</span>: [<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>]

<span class="pl-v">TASK</span> [<span class="pl-s1">create</span> <span class="pl-s1">user</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">changed</span>: [<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>]

<span class="pl-v">PLAY</span> <span class="pl-v">RECAP</span> <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>           : <span class="pl-s1">ok</span><span class="pl-c1">=</span><span class="pl-c1">2</span>    <span class="pl-s1">changed</span><span class="pl-c1">=</span><span class="pl-c1">1</span>    <span class="pl-s1">unreachable</span><span class="pl-c1">=</span><span class="pl-c1">0</span>    <span class="pl-s1">failed</span><span class="pl-c1">=</span><span class="pl-c1">0</span></pre></div>
<p dir="auto">When I rerun the same playbook I get an error</p>
<p dir="auto">Just trying to work out if there is anything obvious I could be doing wrong.</p>
<p dir="auto">I have verified that I can login to the created account.</p>
<p dir="auto">verbose output is not much different:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TASK [create user] *********************************
task path: /root/ansible_windows/createuser-playbook.yml:9
Using module file /usr/lib/python2.6/site-packages/ansible/modules/windows/win_user.ps1
&lt;dsy-demo-mssql02&gt; ESTABLISH WINRM CONNECTION FOR USER: local\\Administrator on PORT 5986 TO dsy-demo-mssql02
EXEC (via pipeline wrapper)
fatal: [dsy-demo-mssql02]: FAILED! =&gt; {
    &quot;changed&quot;: false,
    &quot;failed&quot;: true,
    &quot;msg&quot;: &quot;Exception calling \&quot;ValidateCredentials\&quot; with \&quot;2\&quot; argument(s): \&quot;The network path was not found.\r\n\&quot;&quot;
}"><pre class="notranslate"><span class="pl-v">TASK</span> [<span class="pl-s1">create</span> <span class="pl-s1">user</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">task</span> <span class="pl-s1">path</span>: <span class="pl-c1">/</span><span class="pl-s1">root</span><span class="pl-c1">/</span><span class="pl-s1">ansible_windows</span><span class="pl-c1">/</span><span class="pl-s1">createuser</span><span class="pl-c1">-</span><span class="pl-s1">playbook</span>.<span class="pl-s1">yml</span>:<span class="pl-c1">9</span>
<span class="pl-v">Using</span> <span class="pl-s1">module</span> <span class="pl-s1">file</span> <span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">ansible</span><span class="pl-c1">/</span><span class="pl-s1">modules</span><span class="pl-c1">/</span><span class="pl-s1">windows</span><span class="pl-c1">/</span><span class="pl-s1">win_user</span>.<span class="pl-s1">ps1</span>
<span class="pl-c1">&lt;</span><span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span><span class="pl-c1">&gt;</span> <span class="pl-v">ESTABLISH</span> <span class="pl-v">WINRM</span> <span class="pl-v">CONNECTION</span> <span class="pl-v">FOR</span> <span class="pl-v">USER</span>: <span class="pl-s1">local</span>\\<span class="pl-v">Administrator</span> <span class="pl-s1">on</span> <span class="pl-v">PORT</span> <span class="pl-c1">5986</span> <span class="pl-v">TO</span> <span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>
<span class="pl-v">EXEC</span> (<span class="pl-s1">via</span> <span class="pl-s1">pipeline</span> <span class="pl-s1">wrapper</span>)
<span class="pl-s1">fatal</span>: [<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>]: <span class="pl-v">FAILED</span>! <span class="pl-c1">=</span><span class="pl-c1">&gt;</span> {
    <span class="pl-s">"changed"</span>: <span class="pl-s1">false</span>,
    <span class="pl-s">"failed"</span>: <span class="pl-s1">true</span>,
    <span class="pl-s">"msg"</span>: <span class="pl-s">"Exception calling <span class="pl-cce">\"</span>ValidateCredentials<span class="pl-cce">\"</span> with <span class="pl-cce">\"</span>2<span class="pl-cce">\"</span> argument(s): <span class="pl-cce">\"</span>The network path was not found.<span class="pl-cce">\r</span><span class="pl-cce">\n</span><span class="pl-cce">\"</span>"</span>
}</pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">the play should return 'ok' as the user already exists</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="PLAY [createuser] ************************

TASK [Gathering Facts] *******************
ok: [dsy-demo-mssql02]

TASK [create user] ***********************
fatal: [dsy-demo-mssql02]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;Exception calling \&quot;ValidateCredentials\&quot; with \&quot;2\&quot; argument(s): \&quot;The network path was not found.\r\n\&quot;&quot;}

NO MORE HOSTS LEFT ***********************
        to retry, use: --limit @/root/ansible_windows/createuser-playbook.retry

PLAY RECAP *******************************
dsy-demo-mssql02           : ok=1    changed=0    unreachable=0    failed=1
"><pre class="notranslate"><span class="pl-v">PLAY</span> [<span class="pl-s1">createuser</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span>

<span class="pl-v">TASK</span> [<span class="pl-v">Gathering</span> <span class="pl-v">Facts</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">ok</span>: [<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>]

<span class="pl-v">TASK</span> [<span class="pl-s1">create</span> <span class="pl-s1">user</span>] <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">fatal</span>: [<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>]: <span class="pl-v">FAILED</span>! <span class="pl-c1">=</span><span class="pl-c1">&gt;</span> {<span class="pl-s">"changed"</span>: <span class="pl-s1">false</span>, <span class="pl-s">"failed"</span>: <span class="pl-s1">true</span>, <span class="pl-s">"msg"</span>: <span class="pl-s">"Exception calling <span class="pl-cce">\"</span>ValidateCredentials<span class="pl-cce">\"</span> with <span class="pl-cce">\"</span>2<span class="pl-cce">\"</span> argument(s): <span class="pl-cce">\"</span>The network path was not found.<span class="pl-cce">\r</span><span class="pl-cce">\n</span><span class="pl-cce">\"</span>"</span>}

<span class="pl-v">NO</span> <span class="pl-v">MORE</span> <span class="pl-v">HOSTS</span> <span class="pl-v">LEFT</span> <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
        <span class="pl-s1">to</span> <span class="pl-s1">retry</span>, <span class="pl-s1">use</span>: <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-s1">limit</span> @<span class="pl-c1">/</span><span class="pl-s1">root</span><span class="pl-c1">/</span><span class="pl-s1">ansible_windows</span><span class="pl-c1">/</span><span class="pl-s1">createuser</span><span class="pl-c1">-</span><span class="pl-s1">playbook</span>.<span class="pl-s1">retry</span>

<span class="pl-v">PLAY</span> <span class="pl-v">RECAP</span> <span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">**</span><span class="pl-c1">*</span>
<span class="pl-s1">dsy</span><span class="pl-c1">-</span><span class="pl-s1">demo</span><span class="pl-c1">-</span><span class="pl-s1">mssql02</span>           : <span class="pl-s1">ok</span><span class="pl-c1">=</span><span class="pl-c1">1</span>    <span class="pl-s1">changed</span><span class="pl-c1">=</span><span class="pl-c1">0</span>    <span class="pl-s1">unreachable</span><span class="pl-c1">=</span><span class="pl-c1">0</span>    <span class="pl-s1">failed</span><span class="pl-c1">=</span><span class="pl-c1">1</span></pre></div>