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

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[root@master ~]# ansible --version
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
"><pre class="notranslate"><code class="notranslate">[root@master ~]# ansible --version
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<h5 dir="auto">OS / ENVIRONMENT</h5>

<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I just setup 2 boxes with RHEL 6.6 and installed ansible on the master node. I setup passwordless ssh for root user between the 2 nodes and can successfully ssh from A (ansible machine) to B without entering password.</p>
<p dir="auto">Now I am trying to run the command:</p>
<p dir="auto">ansible all -m ping -i /app/ansible/env</p>
<p dir="auto">But am getting the ERROR everytime</p>
<p dir="auto">10.0.0.23 | FAILED! =&gt; {<br>
"failed": true,<br>
"msg": "failed to resolve remote temporary directory from ansible-tmp-1468175944.42-138203382041728: <code class="notranslate">( umask 77 &amp;&amp; mkdir -p \"</code> echo $HOME/.ansible/tmp/ansible-tmp-1468175944.42-138203382041728 <code class="notranslate">\" &amp;&amp; echo ansible-tmp-1468175944.42-138203382041728=\"</code> echo $HOME/.ansible/tmp/ansible-tmp-1468175944.42-138203382041728 <code class="notranslate">\" )</code> returned empty string"<br>
}</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible all -m ping -i /app/ansible/env"><pre class="notranslate"><code class="notranslate">ansible all -m ping -i /app/ansible/env
</code></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Was expecting a successful ping</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="10.0.0.23 | FAILED! =&gt; {
    &quot;failed&quot;: true, 
    &quot;msg&quot;: &quot;failed to resolve remote temporary directory from ansible-tmp-1468175944.42-138203382041728: `( umask 77 &amp;&amp; mkdir -p \&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1468175944.42-138203382041728 `\&quot; &amp;&amp; echo ansible-tmp-1468175944.42-138203382041728=\&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1468175944.42-138203382041728 `\&quot; )` returned empty string&quot;
}"><pre class="notranslate"><code class="notranslate">10.0.0.23 | FAILED! =&gt; {
    "failed": true, 
    "msg": "failed to resolve remote temporary directory from ansible-tmp-1468175944.42-138203382041728: `( umask 77 &amp;&amp; mkdir -p \"` echo $HOME/.ansible/tmp/ansible-tmp-1468175944.42-138203382041728 `\" &amp;&amp; echo ansible-tmp-1468175944.42-138203382041728=\"` echo $HOME/.ansible/tmp/ansible-tmp-1468175944.42-138203382041728 `\" )` returned empty string"
}
</code></pre></div>
<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>