<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 1.9.4
  configured module search path = None"><pre class="notranslate"><code class="notranslate">ansible 1.9.4
  configured module search path = None
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">No changes to /etc/ansible/ansible.cfg</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">ALL  CentOS release 6.6 (Final)</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">\u001b[?25h\u001b[0G\u001b[K\u001b[?25h\u001b[0G\u001b[K/usr/bin/python: can't open file '\u001b[?25h\u001b[0G\u001b[K\u001b[?25h\u001b[0G\u001b[K/home/webdev/.ansible/tmp/ansible-tmp-1460969185.96-153456172544662/command': [Errno 2] No such file or directory<br>
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013\ndebug1: Reading configuration data /etc/ssh/ssh_config<br>
debug1: Applying options for *<br>
debug1: Connecting to 172.28.0.10 [172.28.0.10] port 32000.<br>
debug1: fd 3 clearing O_NONBLOCK<br>
debug1: Connection established.<br>
debug1: identity file /home/webdev/.ssh/identity type -1<br>
debug1: identity file /home/webdev/.ssh/identity-cert type -1<br>
debug1: identity file /home/webdev/.ssh/id_rsa type 1<br>
debug1: identity file /home/webdev/.ssh/id_rsa-cert type -1<br>
debug1: identity file /home/webdev/.ssh/id_dsa type -1<br>
debug1: identity file /home/webdev/.ssh/id_dsa-cert type -1<br>
debug1: identity file /home/webdev/.ssh/id_ecdsa type -1<br>
debug1: identity file /home/webdev/.ssh/id_ecdsa-cert type -1<br>
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3<br>
debug1: match: OpenSSH_5.3 pat OpenSSH*<br>
debug1: Enabling compatibility mode for protocol 2.0<br>
debug1: Local version string SSH-2.0-OpenSSH_5.3<br>
debug1: SSH2_MSG_KEXINIT sent<br>
debug1: SSH2_MSG_KEXINIT received<br>
debug1: kex: server-&gt;client aes128-ctr hmac-md5 <a href="mailto:zlib@openssh.com">zlib@openssh.com</a><br>
debug1: kex: client-&gt;server aes128-ctr hmac-md5 <a href="mailto:zlib@openssh.com">zlib@openssh.com</a><br>
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024&lt;1024&lt;8192) sent<br>
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP<br>
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent<br>
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY<br>
debug1: checking without port identifier<br>
Warning: Permanently added '[172.28.0.10]:32000' (RSA) to the list of known hosts.<br>
debug1: ssh_rsa_verify: signature correct<br>
debug1: SSH2_MSG_NEWKEYS sent<br>
debug1: expecting SSH2_MSG_NEWKEYS<br>
debug1: SSH2_MSG_NEWKEYS received<br>
debug1: SSH2_MSG_SERVICE_REQUEST sent<br>
debug1: SSH2_MSG_SERVICE_ACCEPT received<br>
debug1: Authentications that can continue: publickey,password<br>
debug1: Next authentication method: password<br>
debug1: Enabling compression at level 6.<br>
debug1: Authentication succeeded (password).<br>
debug1: channel 0: new [client-session]<br>
debug1: Requesting <a href="mailto:no-more-sessions@openssh.com">no-more-sessions@openssh.com</a><br>
debug1: Entering interactive session.<br>
debug1: Sending environment.<br>
debug1: Sending env LANG = C<br>
debug1: Sending command: /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python \033[?25h\033[0G\033[K\033[?25h\033[0G\033[K/home/webdev/.ansible/tmp/ansible-tmp-1460969185.96-153456172544662/command; rm -rf \033[?25h\033[0G\033[K\033[?25h\033[0G\033[K/home/webdev/.ansible/tmp/ansible-tmp-1460969185.96-153456172544662/ &gt;/dev/null 2&gt;&amp;1'<br>
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0<br>
debug1: client_input_channel_req: channel 0 rtype <a href="mailto:eow@openssh.com">eow@openssh.com</a> reply 0<br>
debug1: channel 0: free: client-session, nchannels 1<br>
debug1: fd 1 clearing O_NONBLOCK<br>
debug1: fd 2 clearing O_NONBLOCK<br>
Connection to 172.28.0.10 closed.<br>
Transferred: sent 1896, received 2224 bytes, in 0.6 seconds<br>
Bytes per second: sent 3016.0, received 3537.8<br>
debug1: Exit status 0<br>
debug1: compress outgoing: raw data 709, compressed 438, factor 0.62<br>
debug1: compress incoming: raw data 324, compressed 246, factor 0.76</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">with the ip 172.18.8.203， get errors：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false' ansible 'all' -u 'webdev' -m shell -a 'rm -rf /data/web_publish/source/kaihubao/detection1460968430'  -f 10 -T 600 -vvvv

&lt;172.18.8.203&gt; ESTABLISH CONNECTION FOR USER: webdev
&lt;172.18.8.203&gt; REMOTE_MODULE command rm -rf /data/web_publish/source/kaihubao/detection1460968430 #USE_SHELL
&lt;172.18.8.203&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=600 172.18.8.203 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005'
/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/command
&lt;172.18.8.203&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,pub/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/ &gt;/dev/null 2&gt;&amp;1'"><pre class="notranslate"><code class="notranslate"> ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false' ansible 'all' -u 'webdev' -m shell -a 'rm -rf /data/web_publish/source/kaihubao/detection1460968430'  -f 10 -T 600 -vvvv

&lt;172.18.8.203&gt; ESTABLISH CONNECTION FOR USER: webdev
&lt;172.18.8.203&gt; REMOTE_MODULE command rm -rf /data/web_publish/source/kaihubao/detection1460968430 #USE_SHELL
&lt;172.18.8.203&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=600 172.18.8.203 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005'
/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/command
&lt;172.18.8.203&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,pub/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/ &gt;/dev/null 2&gt;&amp;1'
</code></pre></div>
<p dir="auto">with the ip 172.18.8.207， it success：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false' ansible 'all' -u 'webdev' -m shell -a 'rm -rf /data/web_publish/source/kaihubao/detection1460968430'  -f 10 -T 600 -vvvv

&lt;172.18.8.207&gt; ESTABLISH CONNECTION FOR USER: webdev
&lt;172.18.8.207&gt; REMOTE_MODULE command rm -rf /data/web_publish/source/kaihubao/detection1460968430 #USE_SHELL
&lt;172.18.8.207&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=600 172.18.8.207 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351'
&lt;172.18.8.207&gt; PUT /tmp/tmptOJ0xX TO /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command
&lt;172.18.8.207&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=600 172.18.8.207 /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command; rm -rf /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/ &gt;/dev/null 2&gt;&amp;1'"><pre class="notranslate"><code class="notranslate"> ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false' ansible 'all' -u 'webdev' -m shell -a 'rm -rf /data/web_publish/source/kaihubao/detection1460968430'  -f 10 -T 600 -vvvv

&lt;172.18.8.207&gt; ESTABLISH CONNECTION FOR USER: webdev
&lt;172.18.8.207&gt; REMOTE_MODULE command rm -rf /data/web_publish/source/kaihubao/detection1460968430 #USE_SHELL
&lt;172.18.8.207&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=600 172.18.8.207 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351'
&lt;172.18.8.207&gt; PUT /tmp/tmptOJ0xX TO /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command
&lt;172.18.8.207&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -o Port=32000 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=600 172.18.8.207 /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command; rm -rf /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/ &gt;/dev/null 2&gt;&amp;1'
</code></pre></div>

<p dir="auto">according to the debug info：<br>
172.18.8.207：<br>
&lt;172.18.8.207&gt; PUT /tmp/tmptOJ0xX TO /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command<br>
172.18.8.203：<br>
does not have a line begin with PUT，and “/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/command” with this line</p>
<p dir="auto">172.18.8.207 and 172.18.8.203 both has created the right directory 。</p>
<h5 dir="auto">EXPECTED RESULTS</h5>

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;!--- Paste verbatim command output between quotes --&gt;"><pre class="notranslate"><code class="notranslate">&lt;!--- Paste verbatim command output between quotes --&gt;
</code></pre></div>
<p dir="auto">From <a href="https://groups.google.com/forum/#!topic/ansible-project/2JDkLFsvMcA" rel="nofollow">https://groups.google.com/forum/#!topic/ansible-project/2JDkLFsvMcA</a></p>
<p dir="auto">I'm having some trouble with the new Ansible 2 when trying to run ping on a host that works with 1.9.4.</p>
<p dir="auto">I'm getting the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible -i test all -m ping -u root -vvvvv -c paramiko

Loaded callback minimal of type stdout, v2.0
&lt;10.10.0.242&gt; ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.10.0.242
&lt;10.10.0.242&gt; EXEC mkdir -p &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542 )&quot; &amp;&amp; echo &quot;$( echo $HOME/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542 )&quot;
&lt;10.10.0.242&gt; PUT /var/folders/1d/nqrbvtz120nb7r2rjqzpvs7m0000gn/T/tmpjR2gSS TO /home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/ping
&lt;10.10.0.242&gt; EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/ping; rm -rf &quot;/home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/&quot; &gt; /dev/null 2&gt;&amp;1
10.10.0.242 | FAILED! =&gt; {
    &quot;changed&quot;: false,
    &quot;failed&quot;: true,
    &quot;invocation&quot;: {
        &quot;module_name&quot;: &quot;ping&quot;
    },
    &quot;module_stderr&quot;: &quot;&quot;,
    &quot;module_stdout&quot;: &quot;\u001b[?1034h{\&quot;invocation\&quot;: {\&quot;module_args\&quot;: {\&quot;data\&quot;: null}}, \&quot;changed\&quot;: false, \&quot;ping\&quot;: \&quot;pong\&quot;}\r\n&quot;,
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;,
    &quot;parsed&quot;: false
}"><pre class="notranslate"><code class="notranslate">$ ansible -i test all -m ping -u root -vvvvv -c paramiko

Loaded callback minimal of type stdout, v2.0
&lt;10.10.0.242&gt; ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.10.0.242
&lt;10.10.0.242&gt; EXEC mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542 )" &amp;&amp; echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542 )"
&lt;10.10.0.242&gt; PUT /var/folders/1d/nqrbvtz120nb7r2rjqzpvs7m0000gn/T/tmpjR2gSS TO /home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/ping
&lt;10.10.0.242&gt; EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/ping; rm -rf "/home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/" &gt; /dev/null 2&gt;&amp;1
10.10.0.242 | FAILED! =&gt; {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "ping"
    },
    "module_stderr": "",
    "module_stdout": "\u001b[?1034h{\"invocation\": {\"module_args\": {\"data\": null}}, \"changed\": false, \"ping\": \"pong\"}\r\n",
    "msg": "MODULE FAILURE",
    "parsed": false
}
</code></pre></div>
<p dir="auto">Previously on 1.9.4 I would get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible -i test all -m ping -u root -vvvvv -c paramiko
&lt;10.10.0.242&gt; ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.10.0.242
&lt;10.10.0.242&gt; REMOTE_MODULE ping
&lt;10.10.0.242&gt; EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466'
&lt;10.10.0.242&gt; PUT /var/folders/1d/nqrbvtz120nb7r2rjqzpvs7m0000gn/T/tmpqHPWsg TO /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ping
&lt;10.10.0.242&gt; EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ping; rm -rf /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ &gt;/dev/null 2&gt;&amp;1'
10.10.0.242 | success &gt;&gt; {
    &quot;changed&quot;: false,
    &quot;ping&quot;: &quot;pong&quot;
}"><pre class="notranslate"><code class="notranslate">$ ansible -i test all -m ping -u root -vvvvv -c paramiko
&lt;10.10.0.242&gt; ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.10.0.242
&lt;10.10.0.242&gt; REMOTE_MODULE ping
&lt;10.10.0.242&gt; EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466'
&lt;10.10.0.242&gt; PUT /var/folders/1d/nqrbvtz120nb7r2rjqzpvs7m0000gn/T/tmpqHPWsg TO /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ping
&lt;10.10.0.242&gt; EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ping; rm -rf /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ &gt;/dev/null 2&gt;&amp;1'
10.10.0.242 | success &gt;&gt; {
    "changed": false,
    "ping": "pong"
}
</code></pre></div>
<p dir="auto">Any idea what the culprit might be?  At first glance the only real difference I can see is that the older version had /bin/sh -c in front, but that could just be a change in logging.</p>
<p dir="auto">Update from: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="126615289" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/13882" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/13882/hovercard?comment_id=171723283&amp;comment_type=issue_comment" href="https://github.com/ansible/ansible/issues/13882#issuecomment-171723283">#13882 (comment)</a></p>
<p dir="auto">The local shell is zsh, the remote term is sh.</p>
<p dir="auto">The issue is that my local TERM environment (xterm-256color) was getting used by paramiko and openssh and sent to the remote system.</p>
<p dir="auto">Temporary workaround, "TERM=vt100 ansible -i ... -m ping" makes everything work peachy.</p>
<p dir="auto">One interesting thing to note is that enabling pipelining makes the problem go away. I was able to track down the issue in the paramiko code,<br>
paramiko_ssh.py:219: chan.get_pty(term=os.getenv('TERM', 'vt100'),</p>
<p dir="auto">The local environment is getting used for TERM instead of always forcing vt100, I couldn't find the corresponding openssh code.</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fspadini/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fspadini">@fspadini</a></p>