# Error: ansible requires a json module, none found!

**URL:** <https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037>\
**Category:** Ansible Project\
**Created:** [June 28, 2013, 3:46pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037 "2013-06-28T15:46:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimon](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Dimon](https://forum.ansible.com/u/Dimon)\
**Post date:** [June 28, 2013, 3:46pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/1 "2013-06-28T15:46:11Z")

</div>

Hi I searched google and only found [https://groups.google.com/forum/#!topic/ansible-project/VvsonX7QrMk](https://groups.google.com/forum/#!topic/ansible-project/VvsonX7QrMk) that deals with the similar problem.

My problem is:

I’m using RHEL6 as my main ansible station (ansible-1.1 from EPEL) and whenever I launch it against RHEL5 boxes I get:

$ ansible [rhe5box.com](http://rhe5box.com) -i my-serverlist -u root -m command -a “ls”

[rhel5box.com](http://rhel5box.com) | FAILED \>\> {  
“failed”: true,  
“msg”: “Error: ansible requires a json module, none found!”,  
“parsed”: false  
}  
$ ssh [root@rhel5box.com](mailto:root@rhel5box.com) python -V  
Python 2.4.3

Sounds like Ansible shouldn’t care for json on remote boxes but for some reason it does - something I’m missing?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [June 28, 2013, 4:14pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/2 "2013-06-28T16:14:02Z")

</div>

Sure, you need to install simplejson on the RHEL 5 boxes.

you can get this from EPEL, or alternatively, use the ‘raw’ module in Ansible to SSH in at a low level and execute a yum install of the URL to the python-simplejson RPM.

---

<div class="post-metadata">

**Author:** ![Patrick\_Regan](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Patrick\_Regan](https://forum.ansible.com/u/Patrick_Regan)\
**Post date:** [June 28, 2013, 4:16pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/3 "2013-06-28T16:16:09Z")

</div>

Ansible requires python-simplejson being installed on EL boxes \< 6. This is how modules can pass information back and forth (roughly).

You can bootstrap all your EL 5 boxes with this command:

ansible [rhe5box.com](http://rhe5box.com) -i my-serverlist -u root -m raw -a"yum install -y python-simplejson"

After that, ansible should work as advertised. This trick is hinted at in the requirements docs here: [http://www.ansibleworks.com/docs/gettingstarted.html#requirements](http://www.ansibleworks.com/docs/gettingstarted.html#requirements)

But more detail can be seen here: [http://www.ansibleworks.com/docs/modules.html#raw](http://www.ansibleworks.com/docs/modules.html#raw)

A case could be made that this explicit issue should be talked about more clearly in the docs. Michael I know takes pull requests on Github. If not, filing an issue on Github might get you somewhere.

---

<div class="post-metadata">

**Author:** ![Ann\_Sybille\_Peters](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Ann\_Sybille\_Peters](https://forum.ansible.com/u/Ann_Sybille_Peters)\
**Post date:** [June 28, 2013, 4:22pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/4 "2013-06-28T16:22:32Z")

</div>

I had this problem too with RHEL. I think there is a RPM simplejson or so. Try that.

also sprach Dmitry Makovey \<droopy4096@gmail.com\> [2013.06.28.1746 +0200]:

---

<div class="post-metadata">

**Author:** ![Dimon](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Dimon](https://forum.ansible.com/u/Dimon)\
**Post date:** [June 28, 2013, 4:46pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/5 "2013-06-28T16:46:42Z")

</div>

Thanks Patrick. That explains the issue. This is a bit unfortunate since it does put _some_ requirement for target system to be “compatible” with ansible whereas my impression was that ansible is “batteries included” kind of approach. However I’ll have to admit that single package shouldn’t be that much of an issue.

---

<div class="post-metadata">

**Author:** ![Dimon](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Dimon](https://forum.ansible.com/u/Dimon)\
**Post date:** [June 28, 2013, 4:52pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/6 "2013-06-28T16:52:54Z")

</div>

FYI found simplejson to be shipped directly from RHN:

yum info python-simplejson  
Loaded plugins: cpacman\_yum, rhnplugin, security  
Available Packages  
Name : python-simplejson  
Arch : i386  
Version : 2.0.9  
Release : 8.el5  
Size : 140 k  
Repo : rhel-i386-server-5  
Summary : Simple, fast, extensible JSON encoder/decoder for Python  
License : MIT  
Description: simplejson is a simple, fast, complete, correct and extensible JSON  
: [http://json.org](http://json.org) encoder and decoder for Python 2.4+. It has no  
: external dependencies.  
:  
: simplejson was formerly known as simple\_json, but changed its name to  
: comply with PEP 8 module naming guidelines.  
:  
: The encoder may be subclassed to provide serialization in any kind of  
: situation, without any special support by the objects to be serialized  
: (somewhat like pickle).  
:  
: The decoder can handle incoming JSON strings of any specified encoding  
: (UTF-8 by default).

---

<div class="post-metadata">

**Author:** ![Patrick\_Regan](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Patrick\_Regan](https://forum.ansible.com/u/Patrick_Regan)\
**Post date:** [June 28, 2013, 5:02pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/7 "2013-06-28T17:02:57Z")

</div>

I think the `raw` module takes care of this IMHO. The ability to bootstrap  
everything from ansible itself keeps it with the "batteries included" part.  
I too have a bunch of RHEL 5 boxes I am managing with Ansible. That single  
raw command got me up and running in less than 10 minutes. It took longer  
to read and understand it than it took to make it actually work.

---

<div class="post-metadata">

**Author:** ![user54](https://avatars.discourse-cdn.com/v4/letter/u/e19b73/32.png) [@user54](https://forum.ansible.com/u/user54)\
**Post date:** [June 2, 2014, 2:55pm UTC](https://forum.ansible.com/t/error-ansible-requires-a-json-module-none-found/13037/8 "2014-06-02T14:55:07Z")

</div>

I encountered the same issue on my Ansible Host, when I try to run -m ping command to one of my linux server. After a detailed error information I got to know that ansible try to generate some files on client machine for that it requires “python-simplejson” available on the remote machine. After Installing the missing “python-simplejson” componant on remote machine I could able to run the command successfully.

-Jidnesh
