Playbook fails on one remote server (running Gentoo), but succeedes on the rest 5 remote servers (running different version of CentOS)

43 views
Skip to first unread message

Dimitar Hristov

unread,
Jun 23, 2015, 10:43:01 AM6/23/15
to ansible...@googlegroups.com
Hi Guys,

I've set up a Playbook to update ACLs on few servers (one running Gentoo, the others are CentOS). The Playbook works fine for the CentOS machines, but fails for the Gentoo one, here's the error:

failed: [gsqtest] => {"failed": true, "parsed": false}

BECOME-SUCCESS-zizdmceeozmgzqpqixbpxrpnjjkfzghn
  File "/home/testuser/.ansible/tmp/ansible-tmp-1435069044.18-160883359153300/service", line 417
    except IOError, err:
                  ^
SyntaxError: invalid syntax
debug1: mux_client_request_session: master session id: 2
Shared connection to gsqtest closed.


FATAL: all hosts have already failed -- aborting


The Playbook has 2 tasks, the first finishes ok, the second one, which is to restart a service, fails.

Any idea what might be the issue?

Regards,
Dimitar

Brian Coca

unread,
Jun 23, 2015, 10:44:25 AM6/23/15
to ansible...@googlegroups.com
on the gentoo machine you are hitting python v3, ansible needs v2 for it's modules, you should either set ansible_python_interpreter for that host to point to the v2 python or change the default python to the v2 version.

------------
Brian Coca


--
Brian Coca

Dimitar Hristov

unread,
Jun 24, 2015, 2:00:09 AM6/24/15
to ansible...@googlegroups.com
Hi Brian,

that's absolutely right. I changed the default python and the playbook passed successfully.
test tmp # eselect python list
Available Python interpreters:
  [1]   python2.7
  [2]   python3.2 *
  [3]   python3.3
test tmp # eselect python set python2.7
test tmp # eselect python list
Available Python interpreters:
  [1]   python2.7 *
  [2]   python3.2
  [3]   python3.3

Thanks,
Dimitar
Reply all
Reply to author
Forward
0 new messages