Netscaler module returns "No module named json"

211 views
Skip to first unread message

Samnang Sen

unread,
Feb 17, 2015, 1:20:27 PM2/17/15
to ansible...@googlegroups.com
I'm running Ansible from a Centos 6 server w/ Python 2.6. My hosts are running RH5 w/ Python 2.4 and I have python-simplejson installed. On the client, "import json" from within the python interpreter doesn't work but "import simplejson" does work.

So if I run the shell module

ansible all -m shell -a "cat /etc/redhat-release" returns values

If I run a playbook that utilizes the netscaler module, I get the following error.

TASK: [disable service in the lb] *********************************************
failed: [web002] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/home/deployment/.ansible/tmp/ansible-tmp-1424196167.51-24867210620940/netscaler", line 100, in ?
    import json
ImportError: No module named json


FATAL: all hosts have already failed -- aborting

Brian Coca

unread,
Feb 17, 2015, 1:23:21 PM2/17/15
to ansible...@googlegroups.com
the netscaler plugin only imports json and not simplejson, this is a
bug as it should work with 2.4




--
Brian Coca

Brian Coca

unread,
Feb 17, 2015, 1:25:31 PM2/17/15
to ansible...@googlegroups.com
try just removing the import json from the file (netscaler.py), it
should not need it at all



--
Brian Coca

Samnang Sen

unread,
Feb 17, 2015, 1:26:38 PM2/17/15
to ansible...@googlegroups.com
Didn't like that. :-)


msg: 'NoneType' object has no attribute 'read'

FATAL: all hosts have already failed -- aborting



Samnang Sen

unread,
Feb 17, 2015, 1:30:16 PM2/17/15
to ansible...@googlegroups.com
Is it attempting to log into the host? Why would it need to do that if the work is being done on the netscaler?



On Tuesday, February 17, 2015 at 1:25:31 PM UTC-5, Brian Coca wrote:

Brian Coca

unread,
Feb 17, 2015, 1:32:08 PM2/17/15
to ansible...@googlegroups.com
use connection: local for that task


--
Brian Coca

Samnang Sen

unread,
Feb 17, 2015, 1:34:26 PM2/17/15
to ansible...@googlegroups.com
Awesome, works!

Thanks a lot.
Reply all
Reply to author
Forward
0 new messages