<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.0.0.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.0.0.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">Using default ansible.cfg.</p>
<p dir="auto">Inventory:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[all:vars]
ansible_python_interpreter=/usr/bin/python2

[kubernetes]
kubemaster1 ansible_ssh_host=192.168.0.150
kubemaster2 ansible_ssh_host=192.168.0.220
kubenode1 ansible_ssh_host=192.168.0.157
kubenode2 ansible_ssh_host=192.168.0.73"><pre class="notranslate"><code class="notranslate">[all:vars]
ansible_python_interpreter=/usr/bin/python2

[kubernetes]
kubemaster1 ansible_ssh_host=192.168.0.150
kubemaster2 ansible_ssh_host=192.168.0.220
kubenode1 ansible_ssh_host=192.168.0.157
kubenode2 ansible_ssh_host=192.168.0.73
</code></pre></div>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Arch Linux (up to date) on all machines.</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">When using any module (I'm using <code class="notranslate">ping</code> for testing), Ansible sometimes fails on a host. It never happens when I use one single host and it fails in about 8/10 cases. The failing hosts are differing.</p>
<p dir="auto">I'm calling Ansible like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible -vvvv -e 'ansible_ssh_user=root' kubernetes -m ping"><pre class="notranslate"><code class="notranslate">ansible -vvvv -e 'ansible_ssh_user=root' kubernetes -m ping
</code></pre></div>
<p dir="auto">Full log output of a failed run:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880 )&quot;'
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006 )&quot;'
&lt;192.168.0.73&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.157&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.73&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.73 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )&quot;'
&lt;192.168.0.220&gt; PUT /tmp/janne/tmpqd8UFn TO /root/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880/ping
&lt;192.168.0.220&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.220]'
&lt;192.168.0.157&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.157 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )&quot;'
&lt;192.168.0.150&gt; PUT /tmp/janne/tmpvvf2uM TO /root/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006/ping
&lt;192.168.0.150&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.150]'
kubenode2 | FAILED! =&gt; {
    &quot;failed&quot;: true,
    &quot;msg&quot;: &quot;ERROR! failed to resolve remote temporary directory from ansible-tmp-1455401136.32-132910215829706: `mkdir -p \&quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )\&quot; &amp;&amp; echo \&quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )\&quot;` returned empty string&quot;
}
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
kubenode1 | FAILED! =&gt; {
    &quot;failed&quot;: true,
    &quot;msg&quot;: &quot;ERROR! failed to resolve remote temporary directory from ansible-tmp-1455401136.32-263198601926357: `mkdir -p \&quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )\&quot; &amp;&amp; echo \&quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )\&quot;` returned empty string&quot;
}
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880/ping; rm -rf &quot;/root/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880/&quot; &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006/ping; rm -rf &quot;/root/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006/&quot; &gt; /dev/null 2&gt;&amp;1'
kubemaster2 | SUCCESS =&gt; {
    &quot;changed&quot;: false,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;data&quot;: null
        },
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;ping&quot;: &quot;pong&quot;
}
kubemaster1 | SUCCESS =&gt; {
    &quot;changed&quot;: false,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;data&quot;: null
        },
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;ping&quot;: &quot;pong&quot;
}"><pre class="notranslate"><code class="notranslate">Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880 )"'
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006 )"'
&lt;192.168.0.73&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.157&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.73&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.73 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )"'
&lt;192.168.0.220&gt; PUT /tmp/janne/tmpqd8UFn TO /root/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880/ping
&lt;192.168.0.220&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.220]'
&lt;192.168.0.157&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.157 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )"'
&lt;192.168.0.150&gt; PUT /tmp/janne/tmpvvf2uM TO /root/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006/ping
&lt;192.168.0.150&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.150]'
kubenode2 | FAILED! =&gt; {
    "failed": true,
    "msg": "ERROR! failed to resolve remote temporary directory from ansible-tmp-1455401136.32-132910215829706: `mkdir -p \"$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )\" &amp;&amp; echo \"$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-132910215829706 )\"` returned empty string"
}
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
kubenode1 | FAILED! =&gt; {
    "failed": true,
    "msg": "ERROR! failed to resolve remote temporary directory from ansible-tmp-1455401136.32-263198601926357: `mkdir -p \"$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )\" &amp;&amp; echo \"$( echo $HOME/.ansible/tmp/ansible-tmp-1455401136.32-263198601926357 )\"` returned empty string"
}
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880/ping; rm -rf "/root/.ansible/tmp/ansible-tmp-1455401136.3-129748284741880/" &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006/ping; rm -rf "/root/.ansible/tmp/ansible-tmp-1455401136.3-110669559663006/" &gt; /dev/null 2&gt;&amp;1'
kubemaster2 | SUCCESS =&gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "data": null
        },
        "module_name": "ping"
    },
    "ping": "pong"
}
kubemaster1 | SUCCESS =&gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "data": null
        },
        "module_name": "ping"
    },
    "ping": "pong"
}
</code></pre></div>
<p dir="auto">Note that different hosts fail sometimes.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Run the command above on a small group of Arch Linux hosts. Sometimes, it fails.</p>
<h5 dir="auto">Expected Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
&lt;192.168.0.157&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.157&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.157 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.7
9-221794005648841 )&quot;'
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.7
9-182183570705768 )&quot;'
&lt;192.168.0.73&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.73&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o C
onnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.73 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-
134588512123476 )&quot;'
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.8-
245049243481998 )&quot;'
&lt;192.168.0.157&gt; PUT /tmp/janne/tmpU2Q_8L TO /root/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841/ping
&lt;192.168.0.157&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ro
ot -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.157]'
&lt;192.168.0.150&gt; PUT /tmp/janne/tmpiBTinc TO /root/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768/ping
&lt;192.168.0.150&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ro
ot -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.150]'
&lt;192.168.0.73&gt; PUT /tmp/janne/tmpV_eY8S TO /root/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476/ping
&lt;192.168.0.73&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=roo
t -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.73]'
&lt;192.168.0.220&gt; PUT /tmp/janne/tmpbllWlE TO /root/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998/ping
&lt;192.168.0.220&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ro
ot -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.220]'
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768/ping
; rm -rf &quot;/root/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768/&quot; &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.157&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.157&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.157 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841/ping
; rm -rf &quot;/root/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841/&quot; &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998/ping;
 rm -rf &quot;/root/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998/&quot; &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.73&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.73&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o C
onnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.73 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476/ping;
rm -rf &quot;/root/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476/&quot; &gt; /dev/null 2&gt;&amp;1'
kubemaster1 | SUCCESS =&gt; {
    &quot;changed&quot;: false,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;data&quot;: null
        },
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;ping&quot;: &quot;pong&quot;
}
kubenode1 | SUCCESS =&gt; {
    &quot;changed&quot;: false,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;data&quot;: null
        },
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;ping&quot;: &quot;pong&quot;
}
kubemaster2 | SUCCESS =&gt; {
    &quot;changed&quot;: false,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;data&quot;: null
        },
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;ping&quot;: &quot;pong&quot;
}
kubenode2 | SUCCESS =&gt; {
    &quot;changed&quot;: false,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;data&quot;: null
        },
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;ping&quot;: &quot;pong&quot;
}"><pre class="notranslate"><code class="notranslate">Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
&lt;192.168.0.157&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.157&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.157 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.7
9-221794005648841 )"'
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.7
9-182183570705768 )"'
&lt;192.168.0.73&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.73&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o C
onnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.73 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.79-
134588512123476 )"'
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1455401324.8-
245049243481998 )"'
&lt;192.168.0.157&gt; PUT /tmp/janne/tmpU2Q_8L TO /root/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841/ping
&lt;192.168.0.157&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ro
ot -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.157]'
&lt;192.168.0.150&gt; PUT /tmp/janne/tmpiBTinc TO /root/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768/ping
&lt;192.168.0.150&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ro
ot -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.150]'
&lt;192.168.0.73&gt; PUT /tmp/janne/tmpV_eY8S TO /root/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476/ping
&lt;192.168.0.73&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=roo
t -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.73]'
&lt;192.168.0.220&gt; PUT /tmp/janne/tmpbllWlE TO /root/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998/ping
&lt;192.168.0.220&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ro
ot -o ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.0.220]'
&lt;192.168.0.150&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.150&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.150 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768/ping
; rm -rf "/root/.ansible/tmp/ansible-tmp-1455401324.79-182183570705768/" &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.157&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.157&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.157 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841/ping
; rm -rf "/root/.ansible/tmp/ansible-tmp-1455401324.79-221794005648841/" &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.220&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.220&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o
ConnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.220 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998/ping;
 rm -rf "/root/.ansible/tmp/ansible-tmp-1455401324.8-245049243481998/" &gt; /dev/null 2&gt;&amp;1'
&lt;192.168.0.73&gt; ESTABLISH SSH CONNECTION FOR USER: root
&lt;192.168.0.73&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o C
onnectTimeout=10 -o ControlPath=/home/janne/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.0.73 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476/ping;
rm -rf "/root/.ansible/tmp/ansible-tmp-1455401324.79-134588512123476/" &gt; /dev/null 2&gt;&amp;1'
kubemaster1 | SUCCESS =&gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "data": null
        },
        "module_name": "ping"
    },
    "ping": "pong"
}
kubenode1 | SUCCESS =&gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "data": null
        },
        "module_name": "ping"
    },
    "ping": "pong"
}
kubemaster2 | SUCCESS =&gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "data": null
        },
        "module_name": "ping"
    },
    "ping": "pong"
}
kubenode2 | SUCCESS =&gt; {
    "changed": false,
    "invocation": {
        "module_args": {
            "data": null
        },
        "module_name": "ping"
    },
    "ping": "pong"
}
</code></pre></div>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">The error that I added above.</p>
<p dir="auto">After I upgrade ansible 2.0.0.1 from 1.9.4, when performing a playlook always encounter intermittent fault "failed to resolve remote temporary directory from".</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible-playbook playlooks/playlook-filters.yml

PLAY ***************************************************************************

TASK [command] *****************************************************************
fatal: [YT_8_22]: FAILED! =&gt; {&quot;failed&quot;: true, &quot;msg&quot;: &quot;ERROR! failed to resolve remote temporary directory from ansible-tmp-1452759681.1-95441304852350: `( umask 22 &amp;&amp; mkdir -p \&quot;$( echo /tmp/.ansible/tmp/ansible-tmp-1452759681.1-95441304852350 )\&quot; &amp;&amp; echo \&quot;$( echo /tmp/.ansible/tmp/ansible-tmp-1452759681.1-95441304852350 )\&quot; )` returned empty string&quot;}
...ignoring

TASK [debug] *******************************************************************
ok: [YT_8_22] =&gt; {
    &quot;msg&quot;: &quot;it failed&quot;
}

PLAY RECAP *********************************************************************
YT_8_22                    : ok=2    changed=0    unreachable=0    failed=0"><pre class="notranslate"><code class="notranslate">$ ansible-playbook playlooks/playlook-filters.yml

PLAY ***************************************************************************

TASK [command] *****************************************************************
fatal: [YT_8_22]: FAILED! =&gt; {"failed": true, "msg": "ERROR! failed to resolve remote temporary directory from ansible-tmp-1452759681.1-95441304852350: `( umask 22 &amp;&amp; mkdir -p \"$( echo /tmp/.ansible/tmp/ansible-tmp-1452759681.1-95441304852350 )\" &amp;&amp; echo \"$( echo /tmp/.ansible/tmp/ansible-tmp-1452759681.1-95441304852350 )\" )` returned empty string"}
...ignoring

TASK [debug] *******************************************************************
ok: [YT_8_22] =&gt; {
    "msg": "it failed"
}

PLAY RECAP *********************************************************************
YT_8_22                    : ok=2    changed=0    unreachable=0    failed=0
</code></pre></div>
<p dir="auto">This is happening for one of the tasks randomly, following are those tasks:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: YT_8_22
  tasks:
    - shell: /bin/true
      register: result
      ignore_errors: True

    - debug: msg=&quot;it failed&quot;
      when: result|failed"><pre class="notranslate"><code class="notranslate">
---
- hosts: YT_8_22
  tasks:
    - shell: /bin/true
      register: result
      ignore_errors: True

    - debug: msg="it failed"
      when: result|failed
</code></pre></div>
<p dir="auto">I try on 1.9.4, have not seen the phenomenon. Can anybody tell me how to do that ?</p>
<p dir="auto">I found another links to similar problems: <a href="https://groups.google.com/forum/#!searchin/ansible-project/Intermittent$20error%7Csort:relevance/ansible-project/FyK6au2O9KY/tWuf31P9AQAJ" rel="nofollow">https://groups.google.com/forum/#!searchin/ansible-project/Intermittent$20error%7Csort:relevance/ansible-project/FyK6au2O9KY/tWuf31P9AQAJ</a></p>