# Netscaler module returns "No module named json"

**URL:** <https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536>\
**Category:** Ansible Project\
**Created:** [February 17, 2015, 6:20pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536 "2015-02-17T18:20:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [February 17, 2015, 6:20pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/1 "2015-02-17T18:20:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 17, 2015, 6:23pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/2 "2015-02-17T18:23:16Z")

</div>

the netscaler plugin only imports json and not simplejson, this is a  
bug as it should work with 2.4

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 17, 2015, 6:25pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/3 "2015-02-17T18:25:05Z")

</div>

try just removing the import json from the file (netscaler.py), it  
should not need it at all

---

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [February 17, 2015, 6:26pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/4 "2015-02-17T18:26:38Z")

</div>

Didn’t like that. 🙂

msg: ‘NoneType’ object has no attribute ‘read’

FATAL: all hosts have already failed – aborting

---

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [February 17, 2015, 6:30pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/5 "2015-02-17T18:30:16Z")

</div>

Is it attempting to log into the host? Why would it need to do that if the work is being done on the netscaler?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 17, 2015, 6:32pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/6 "2015-02-17T18:32:04Z")

</div>

use connection: local for that task

---

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [February 17, 2015, 6:34pm UTC](https://forum.ansible.com/t/netscaler-module-returns-no-module-named-json/17536/7 "2015-02-17T18:34:26Z")

</div>

Awesome, works!

Thanks a lot.
