Hello,

I am currently installing ansible for managing ~200 equal DNS/DHCP 
appliances running linux. As a first step, I added them to the ansible host 
file and created a first playbook, which does nothing than executing "ls 
-al". This works on 198 of the hosts, but two of them are making trouble.

When executing an ad-hoc command like "ansible problemhost1.example.com -a 
"ls -al" -u root -vvvv", the following error is shown:

---
No config file found; using defaults
Loaded callback minimal of type stdout, v2.0
<problemhost1.example.com> ESTABLISH SSH CONNECTION FOR USER: root
<problemhost1.example.com> 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/cnsadmin/.ansible/cp/ansible-ssh-%h-%p-%r -tt 
problemhost1.example.com 'mkdir -p "$( echo 
$HOME/.ansible/tmp/ansible-tmp-1450794251.19-144409971646051 )" && echo "$( 
echo $HOME/.ansible/tmp/ansible-tmp-1450794251.19-144409971646051 )"'
<problemhost1.example.com> PUT /tmp/tmpcEOpAi TO 
/root/.ansible/tmp/ansible-tmp-1450794251.19-144409971646051/command
<problemhost1.example.com> 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/cnsadmin/.ansible/cp/ansible-ssh-%h-%p-%r 
'[problemhost1.example.com]'
<problemhost1.example.com> ESTABLISH SSH CONNECTION FOR USER: root
<problemhost1.example.com> 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/cnsadmin/.ansible/cp/ansible-ssh-%h-%p-%r -tt 
problemhost1.example.com 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 
LC_MESSAGES=en_US.UTF-8 /usr/bin/python 
/root/.ansible/tmp/ansible-tmp-1450794251.19-144409971646051/command; rm 
-rf "/root/.ansible/tmp/ansible-tmp-1450794251.19-144409971646051/" > 
/dev/null 2>&1'
problemhost1.example.com | FAILED | rc=0 >>
bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): 
No such file or directory
Traceback (most recent call last):
  File 
"/root/.ansible/tmp/ansible-tmp-1450794251.19-144409971646051/command", 
line 28, in <module>
    import shlex
  File "/usr/lib/python2.7/shlex.py", line 12, in <module>
    from collections import deque
  File "/usr/lib/python2.7/collections.py", line 12, in <module>
    import heapq as _heapq
EOFError: EOF read where object expected
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 907
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 0
Shared connection to problemhost1.example.com closed.
---

The same command when using another host works fine. Normal SSH login from 
CLI works. I compared both locale settings on the machines:

--- working host ---
root@workinghost:~# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
en_CA.utf8

root@workinghost:~# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=
--- end working host ---

--- failing host ---
root@failinghost:~# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
en_CA.utf8

root@failinghost:~# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=
--- end failing host ---

Any idea what is going wrong here? Both appliances are from the same vendor 
and using the same software release. Both have python2.7.3 installed.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b3fc0c68-ae80-4b47-a949-12e2cc9263a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to