Re: [ansible-project] First command (ping) failure

1,109 views
Skip to first unread message

Michael DeHaan

unread,
Mar 12, 2013, 9:50:39 AM3/12/13
to ansible...@googlegroups.com
>>>> import paramiko
>>>> exit()
> up-tools-vm1:145>
>
>
> No errors to speak of...

This is why the RPM and the pip package have dependencies :)


>
>
> Second try:
>
>
> up-tools-vm0:202> /usr/local/bin/ansible -m ping all -c ssh
> up-tools-vm3.host.com | FAILED >> {
> "failed": true,
> "msg": "Traceback (most recent call last):\r\n File
> \"/users/briawagn/.ansible/tmp/ansible-1363026940.2-139139936304829/ping\",
> line 72, in ?\r\n import simplejson as json\r\n File
> \"/usr/local/lib/python2.7/site-packages/simplejson/__init__.py\", line
> 113\r\n from .scanner import JSONDecodeError\r\n
> ^\r\nSyntaxError: invalid syntax\r\n",
> "parsed": false
> }
>
> up-tools-vm1.host.com | FAILED >> {
> "failed": true,
> "msg": "Traceback (most recent call last):\r\n File
> \"/users/briawagn/.ansible/tmp/ansible-1363026940.2-234698348720126/ping\",
> line 72, in ?\r\n import simplejson as json\r\n File
> \"/usr/local/lib/python2.7/site-packages/simplejson/__init__.py\", line
> 113\r\n from .scanner import JSONDecodeError\r\n
> ^\r\nSyntaxError: invalid syntax\r\n",
> "parsed": false
> }
>
> up-tools-vm2.host.com | FAILED >> {
> "failed": true,
> "msg": "Traceback (most recent call last):\r\n File
> \"/users/briawagn/.ansible/tmp/ansible-1363026940.2-26483154043858/ping\",
> line 72, in ?\r\n import simplejson as json\r\n File
> \"/usr/local/lib/python2.7/site-packages/simplejson/__init__.py\", line
> 113\r\n from .scanner import JSONDecodeError\r\n
> ^\r\nSyntaxError: invalid syntax\r\n",
> "parsed": false
> }
>
> up-tools-vm5.host.com | FAILED >> {
> "failed": true,
> "msg": "Traceback (most recent call last):\r\n File
> \"/users/briawagn/.ansible/tmp/ansible-1363026940.21-155156487341757/ping\",
> line 72, in ?\r\n import simplejson as json\r\n File
> \"/usr/local/lib/python2.7/site-packages/simplejson/__init__.py\", line
> 113\r\n from .scanner import JSONDecodeError\r\n
> ^\r\nSyntaxError: invalid syntax\r\n",
> "parsed": false
> }
>
> up-tools-vm4.host.com | FAILED >> {
> "failed": true,
> "msg": "Traceback (most recent call last):\r\n File
> \"/users/briawagn/.ansible/tmp/ansible-1363026940.21-97092027123506/ping\",
> line 72, in ?\r\n import simplejson as json\r\n File
> \"/usr/local/lib/python2.7/site-packages/simplejson/__init__.py\", line
> 113\r\n from .scanner import JSONDecodeError\r\n
> ^\r\nSyntaxError: invalid syntax\r\n",
> "parsed": false
> }


I believe this was recently resolved by a commit from Brian Coca
(where he only made it raise a better error message indicating the the
wrong JSON module being installed). Let us know if you are still
having problems.

Installing from pip or the RPM/etc, is a good way to go.

Hope you are set, if not, let us know.

Brian Coca

unread,
Mar 12, 2013, 9:58:20 AM3/12/13
to ansible...@googlegroups.com
I just solved similar issue, the problem is probably that you are
executing an older python (2.4) and importing the newer simplejson
(2.7). Try setting ansible_python_interpreter to the python2.7
executable.
--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno

Brian Coca

unread,
Mar 12, 2013, 9:59:18 AM3/12/13
to ansible...@googlegroups.com
BTW, you should only need paramiko on the 'manager' box for ping to succeed.

Rebeca González Álvarez

unread,
Aug 18, 2014, 5:38:47 AM8/18/14
to ansible...@googlegroups.com
Hello everybody,

I'm *super* new to ansible. I just installed it following the instructions and configured my servername at the hosts file. When I try to do ping to my hosting I get this:

becca@becca-LAPTOP:/$ ansible all -m ping -vvvv
<sg111.servergrove.com> ESTABLISH CONNECTION FOR USER: bybeccae
<sg111.servergrove.com> REMOTE_MODULE ping
<sg111.servergrove.com> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/becca/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22123', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=bybeccae', '-o', 'ConnectTimeout=10', 'sg111.servergrove.com', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1408354432.25-81121490636964 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1408354432.25-81121490636964 && echo $HOME/.ansible/tmp/ansible-tmp-1408354432.25-81121490636964'"]
<sg111.servergrove.com> PUT /tmp/tmpvlo17x TO mkdir: cannot create directory `//.ansible': Permission denied/ping
<sg111.servergrove.com> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/becca/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22123', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=bybeccae', '-o', 'ConnectTimeout=10', 'sg111.servergrove.com', u'/bin/sh -c \'LANG=C LC_CTYPE=C /usr/bin/python mkdir: cannot create directory `//.ansible\'"\'"\': Permission denied/ping\'']
sg111.servergrove.com | FAILED >> {
    "failed": true, 
    "msg": "/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'\r\n/bin/sh: -c: line 1: syntax error: unexpected end of file\r\nOpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_request_forwards: requesting forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 7261\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to sg111.servergrove.com closed.\r\n", 
    "parsed": false
}


my hosts file looks like this: 

# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
#   - Comments begin with the '#' character
#   - Blank lines are ignored
#   - Groups of hosts are delimited by [header] elements
#   - You can enter hostnames or ip addresses
#   - A hostname/ip can be a member of multiple groups

# Ex 1: Ungrouped hosts, specify before any group headers.

sg111.servergrove.com:22123 ansible_connection=ssh ansible_ssh_user=bybeccae

# Ex 2: A collection of hosts belonging to the 'webservers' group

# If you have multiple hosts following a pattern you can specify
# them like this:

# Ex 3: A collection of database servers in the 'dbservers' group

[dbservers]


# Here's another example of host ranges, this time there are no
# leading 0s:

What am I doing wrong??? I'll appreciate any kind of help :) Thank you in advance!

Michael DeHaan

unread,
Aug 18, 2014, 8:40:45 AM8/18/14
to ansible...@googlegroups.com
(A) First question, what version of Ansible are you running?

(B) Second question, have you configured the ansible temp path in ansible.cfg or as an environment variable, and if so what is it set to?

Thanks!



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5f3fd9af-7631-438f-9fc9-d0185cf58b78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages