Issue 1:
ISSUE TYPE

Bug Report

ANSIBLE VERSION

ansible 1.9.4
configured module search path = None

CONFIGURATION

No changes to /etc/ansible/ansible.cfg

OS / ENVIRONMENT

ALL CentOS release 6.6 (Final)

SUMMARY

\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

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013\ndebug1: Reading configuration data /etc/ssh/ssh_config

debug1: Applying options for *

debug1: Connecting to 172.28.0.10 [172.28.0.10] port 32000.

debug1: fd 3 clearing O_NONBLOCK

debug1: Connection established.

debug1: identity file /home/webdev/.ssh/identity type -1

debug1: identity file /home/webdev/.ssh/identity-cert type -1

debug1: identity file /home/webdev/.ssh/id_rsa type 1

debug1: identity file /home/webdev/.ssh/id_rsa-cert type -1

debug1: identity file /home/webdev/.ssh/id_dsa type -1

debug1: identity file /home/webdev/.ssh/id_dsa-cert type -1

debug1: identity file /home/webdev/.ssh/id_ecdsa type -1

debug1: identity file /home/webdev/.ssh/id_ecdsa-cert type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3

debug1: match: OpenSSH_5.3 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.3

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: server->client aes128-ctr hmac-md5 zlib@openssh.com

debug1: kex: client->server aes128-ctr hmac-md5 zlib@openssh.com

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug1: checking without port identifier

Warning: Permanently added '[172.28.0.10]:32000' (RSA) to the list of known hosts.

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,password

debug1: Next authentication method: password

debug1: Enabling compression at level 6.

debug1: Authentication succeeded (password).

debug1: channel 0: new [client-session]

debug1: Requesting no-more-sessions@openssh.com

debug1: Entering interactive session.

debug1: Sending environment.

debug1: Sending env LANG = C

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/ >/dev/null 2>&1'

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0

debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0

debug1: channel 0: free: client-session, nchannels 1

debug1: fd 1 clearing O_NONBLOCK

debug1: fd 2 clearing O_NONBLOCK

Connection to 172.28.0.10 closed.

Transferred: sent 1896, received 2224 bytes, in 0.6 seconds

Bytes per second: sent 3016.0, received 3537.8

debug1: Exit status 0

debug1: compress outgoing: raw data 709, compressed 438, factor 0.62

debug1: compress incoming: raw data 324, compressed 246, factor 0.76

STEPS TO REPRODUCE

with the ip 172.18.8.203， get errors：

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

<172.18.8.203> ESTABLISH CONNECTION FOR USER: webdev
<172.18.8.203> REMOTE_MODULE command rm -rf /data/web_publish/source/kaihubao/detection1460968430 #USE_SHELL
<172.18.8.203> 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 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005 && echo $HOME/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005'
/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/command
<172.18.8.203> 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/ >/dev/null 2>&1'

with the ip 172.18.8.207， it success：

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

<172.18.8.207> ESTABLISH CONNECTION FOR USER: webdev
<172.18.8.207> REMOTE_MODULE command rm -rf /data/web_publish/source/kaihubao/detection1460968430 #USE_SHELL
<172.18.8.207> 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 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351 && echo $HOME/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351'
<172.18.8.207> PUT /tmp/tmptOJ0xX TO /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command
<172.18.8.207> 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/ >/dev/null 2>&1'

according to the debug info：

172.18.8.207：

<172.18.8.207> PUT /tmp/tmptOJ0xX TO /home/webdev/.ansible/tmp/ansible-tmp-1460977186.14-114412108948351/command

172.18.8.203：

does not have a line begin with PUT，and “/home/webdev/.ansible/tmp/ansible-tmp-1460980711.71-205018944211005/command” with this line

172.18.8.207 and 172.18.8.203 both has created the right directory 。

EXPECTED RESULTS

ACTUAL RESULTS

<!--- Paste verbatim command output between quotes -->

Issue 2:
From https://groups.google.com/forum/#!topic/ansible-project/2JDkLFsvMcA

I'm having some trouble with the new Ansible 2 when trying to run ping on a host that works with 1.9.4.

I'm getting the following:

$ ansible -i test all -m ping -u root -vvvvv -c paramiko

Loaded callback minimal of type stdout, v2.0
<10.10.0.242> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.10.0.242
<10.10.0.242> EXEC mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542 )"
<10.10.0.242> PUT /var/folders/1d/nqrbvtz120nb7r2rjqzpvs7m0000gn/T/tmpjR2gSS TO /home/root/.ansible/tmp/ansible-tmp-1452643119.18-173252181839542/ping
<10.10.0.242> 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/" > /dev/null 2>&1
10.10.0.242 | FAILED! => {
"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
}

Previously on 1.9.4 I would get:

$ ansible -i test all -m ping -u root -vvvvv -c paramiko
<10.10.0.242> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.10.0.242
<10.10.0.242> REMOTE_MODULE ping
<10.10.0.242> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466 && echo $HOME/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466'
<10.10.0.242> PUT /var/folders/1d/nqrbvtz120nb7r2rjqzpvs7m0000gn/T/tmpqHPWsg TO /home/root/.ansible/tmp/ansible-tmp-1452643204.88-178243528154466/ping
<10.10.0.242> 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/ >/dev/null 2>&1'
10.10.0.242 | success >> {
"changed": false,
"ping": "pong"
}

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.

Update from: #13882 (comment)

The local shell is zsh, the remote term is sh.

The issue is that my local TERM environment (xterm-256color) was getting used by paramiko and openssh and sent to the remote system.

Temporary workaround, "TERM=vt100 ansible -i ... -m ping" makes everything work peachy.

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,

paramiko_ssh.py:219: chan.get_pty(term=os.getenv('TERM', 'vt100'),

The local environment is getting used for TERM instead of always forcing vt100, I couldn't find the corresponding openssh code.

/cc @fspadini