# Not using simplejson

**URL:** <https://forum.ansible.com/t/not-using-simplejson/18825>\
**Category:** Ansible Project\
**Created:** [July 22, 2015, 6:04pm UTC](https://forum.ansible.com/t/not-using-simplejson/18825 "2015-07-22T18:04:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [July 22, 2015, 6:04pm UTC](https://forum.ansible.com/t/not-using-simplejson/18825/1 "2015-07-22T18:04:55Z")

</div>

If I do not want to have simplejson in the client/node, how much  
of ansible's features do I lose? From what I found I can only run raw  
commands, but I hope I am wrong. Can someone shine some rays of hope  
my way?

---

<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:** [July 22, 2015, 7:37pm UTC](https://forum.ansible.com/t/not-using-simplejson/18825/2 "2015-07-22T19:37:01Z")

</div>

pretty much raw is the only thing you can run w/o a json library, what  
version of python are you running on the targets?

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [July 22, 2015, 7:47pm UTC](https://forum.ansible.com/t/not-using-simplejson/18825/3 "2015-07-22T19:47:50Z")

</div>

> pretty much raw is the only thing you can run w/o a json library, what  
> version of python are you running on the targets?

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For this specific target,

~ # python -V  
Python 2.6.7  
~ #

---

<div class="post-metadata">

**Author:** ![Timothy\_Appnel1](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@Timothy\_Appnel1](https://forum.ansible.com/u/Timothy_Appnel1)\
**Post date:** [July 22, 2015, 7:53pm UTC](https://forum.ansible.com/t/not-using-simplejson/18825/4 "2015-07-22T19:53:52Z")

</div>

Then you have json (what simplejson became when it was brought in to the python core).

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [July 22, 2015, 8:09pm UTC](https://forum.ansible.com/t/not-using-simplejson/18825/5 "2015-07-22T20:09:41Z")

</div>

> Then you have json (what simplejson became when it was brought in to the  
> python core). \<tim/\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;That's nice to know! And, there it is!

~ # python  
Python 2.6.7 (r267:88850, Jun 9 2014, 18:31:44)  
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2  
Type "help", "copyright", "credits" or "license" for more information.

> > > import json

~ #

But when I try to do something simple, get date in raw mode,

[ansible@scan ansible]$ ansible vmhosts -m raw -a 'date'  
vmhost2.example.com | success | rc=0 \>\>  
Wed Jul 22 20:15:50 UTC 2015

[ansible@scan ansible]$

it works, but

[ansible@scan ansible]$ ansible vmhosts -a date  
vmhost2.example.com | FAILED \>\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"failed": true,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "Traceback (most recent call last):\r\n File  
\"//.ansible/tmp/ansible-tmp-1437550117.11-115799489197738/command\",  
line 294, in \<module\>\r\n import grp\r\nImportError: No module  
named grp\r\nOpenSSH\_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013\ndebug1:  
Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: Applying  
options for \*\r\ndebug1: Connecting to vmhost2.example.com [10.0.0.20]  
port 22.\r\ndebug1: fd 3 clearing O\_NONBLOCK\r\ndebug1: Connection  
established.\r\ndebug1: identity file  
/home/ansible/ansible/roles/vmhosts/files/vmhost2 type -1\r\ndebug1:  
identity file /home/ansible/ansible/roles/vmhosts/files/vmhost2-cert  
type -1\r\ndebug1: Remote protocol version 2.0, remote software  
version OpenSSH\_5.6\r\ndebug1: match: OpenSSH\_5.6 pat  
OpenSSH\*\r\ndebug1: Enabling compatibility mode for protocol  
2.0\r\ndebug1: Local version string SSH-2.0-OpenSSH\_5.3\r\ndebug1:  
SSH2\_MSG\_KEXINIT sent\r\ndebug1: SSH2\_MSG\_KEXINIT received\r\ndebug1:  
kex: server-\>client aes128-ctr hmac-sha1 zlib@openssh.com\r\ndebug1:  
kex: client-\>server aes128-ctr hmac-sha1 zlib@openssh.com\r\ndebug1:  
SSH2\_MSG\_KEX\_DH\_GEX\_REQUEST(1024\<2048\<8192) sent\r\ndebug1: expecting  
SSH2\_MSG\_KEX\_DH\_GEX\_GROUP\r\ndebug1: SSH2\_MSG\_KEX\_DH\_GEX\_INIT  
sent\r\ndebug1: expecting SSH2\_MSG\_KEX\_DH\_GEX\_REPLY\r\ndebug1: Host  
'vmhost2.example.com' is known and matches the RSA host  
key.\r\ndebug1: Found key in  
/home/ansible/.ssh/known\_hosts:2\r\ndebug1: ssh\_rsa\_verify: signature  
correct\r\ndebug1: SSH2\_MSG\_NEWKEYS sent\r\ndebug1: expecting  
SSH2\_MSG\_NEWKEYS\r\ndebug1: SSH2\_MSG\_NEWKEYS received\r\ndebug1:  
SSH2\_MSG\_SERVICE\_REQUEST sent\r\ndebug1: SSH2\_MSG\_SERVICE\_ACCEPT  
received\r\ndebug1: Authentications that can continue:  
publickey,keyboard-interactive\r\ndebug1: Next authentication method:  
publickey\r\ndebug1: Trying private key:  
/home/ansible/ansible/roles/vmhosts/files/vmhost2\r\ndebug1: read PEM  
private key done: type RSA\r\ndebug1: Enabling compression at level  
6.\r\ndebug1: Authentication succeeded (publickey).\r\ndebug1: channel  
0: new [client-session]\r\ndebug1: Requesting  
no-more-sessions@openssh.com\r\ndebug1: Entering interactive  
session.\r\ndebug1: Sending environment.\r\ndebug1: Sending env LANG =  
en\_US.UTF-8\r\ndebug1: Sending command: /bin/sh -c 'LANG=en\_US.UTF-8  
LC\_CTYPE=en\_US.UTF-8 /usr/bin/python  
//.ansible/tmp/ansible-tmp-1437550117.11-115799489197738/command; rm  
-rf //.ansible/tmp/ansible-tmp-1437550117.11-115799489197738/

> /dev/null 2\>&1'\r\ndebug1: client\_input\_channel\_req: channel 0 rtype

exit-status reply 0\r\ndebug1: client\_input\_channel\_req: channel 0  
rtype eow@openssh.com reply 0\r\ndebug1: channel 0: free:  
client-session, nchannels 1\r\ndebug1: fd 1 clearing  
O\_NONBLOCK\r\ndebug1: fd 2 clearing O\_NONBLOCK\r\nConnection to  
vmhost2.example.com closed.\r\nTransferred: sent 2504, received 2072  
bytes, in 0.1 seconds\r\nBytes per second: sent 31236.7, received  
25847.6\r\ndebug1: Exit status 0\r\ndebug1: compress outgoing: raw  
data 662, compressed 421, factor 0.64\r\ndebug1: compress incoming:  
raw data 316, compressed 258, factor 0.82\r\n",  
&nbsp;&nbsp;&nbsp;&nbsp;"parsed": false  
}

[ansible@scan ansible]$

I then realize I am barking at the wrong tree: the target does not  
have the grp module.
