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.
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.
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.
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 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).
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.
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.