Ansible seems can not parse response from remote host due to locale issue.

136 views
Skip to first unread message

fengnan zhao

unread,
Jul 2, 2015, 9:33:02 PM7/2/15
to ansible...@googlegroups.com
Repost to fix some grammar error: 

Hi guys, I am new to Ansible and playing some basic commands now. 

I run the following command against different remote hosts, and found that the results are different : 

zhaof@fnz:~/work/tools $ ansible tffxa05l.unix.bla -m ping -u fengnaz1 --ask-pass
SSH password:
tffxa05l.unix.bla | success >> {
    "changed": false,
    "ping": "pong"
}


all good !

However when I run against another remote host, I got : 

zhaof@fnz:~/work/tools $ ansible tffxa04z.unix.bla -m ping -u fengnaz1 --ask-pass
SSH password:
tffxa04z.unix.bla | FAILED >> {
    "failed": true,
    "msg": "couldn't set locale correctly\r\ncouldn't set locale correctly\r\n/bin/sh: /usr/bin/python: not found\r\nOpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: mux_client_request_session: master session id: 2\r\nShared connection to tffxa04z.unix.anz closed.\r\n",
    "parsed": false
}


It seems that the Ansible can not parse the response from tffxa04z . A locale problem ? 

Has anyone experienced the similar issue?  Can your pls share your insight and solution ? 

thanks & regards 

Fengnan 

Brian Coca

unread,
Jul 4, 2015, 1:07:30 PM7/4/15
to ansible...@googlegroups.com
The issue seems to be that it is not finding python, its looking at
/usr/bin/python, if python is elsewhere use ansible_python_interpreter
for that host to point to the correct location.

--
Brian Coca

fengnan zhao

unread,
Jul 5, 2015, 5:41:12 AM7/5/15
to ansible...@googlegroups.com
thanks Brian - that is exactly the problem.  Tffxa04z doesn't have python installed.
 
However,   we assumed the ansible doesn't rely on the the python/agent installed  on the managed node - and that is why we chose Ansible over other tools ( puppet, chef or Salt ) .
Is the SSHD running on the controlled node good enough ?
 
Our assumption seems to be wrong ...
 
thanks & Regards

Brian Coca

unread,
Jul 5, 2015, 2:56:44 PM7/5/15
to ansible...@googlegroups.com
ansible does not require an agent, it does require python with json
installed on the target though (as documented here
http://docs.ansible.com/intro_installation.html#managed-node-requirements).
With out it you can still use ansible, but limited to the raw module
(normally used to install python).



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages