Discussion:
[ansible-project] Not using simplejson
Mauricio Tavares
2015-07-22 18:04:55 UTC
Permalink
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?
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAHEKYV6hJoBur%2BfVC5u%2BgcKzhkhSX8AUOcqFqMGTsZAt_RHp0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Brian Coca
2015-07-22 19:37:01 UTC
Permalink
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?
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kBMXaCZLzar7e7Gi6fxni6DL6bqFqnqaVe%2BRfVgO0afA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Mauricio Tavares
2015-07-22 19:47:50 UTC
Permalink
Post by Brian Coca
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?
For this specific target,

~ # python -V
Python 2.6.7
~ #
Post by Brian Coca
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kBMXaCZLzar7e7Gi6fxni6DL6bqFqnqaVe%2BRfVgO0afA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAHEKYV5ku0dPnR0hexj%3DHY%2B2ZsKiFdzktCWBgDfOD7yKvXy4XQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Timothy Appnel
2015-07-22 19:53:52 UTC
Permalink
Then you have json (what simplejson became when it was brought in to the
python core). <tim/>
Post by Mauricio Tavares
Post by Brian Coca
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?
For this specific target,
~ # python -V
Python 2.6.7
~ #
Post by Brian Coca
--
Brian Coca
--
You received this message because you are subscribed to the Google
Groups "Ansible Project" group.
Post by Brian Coca
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kBMXaCZLzar7e7Gi6fxni6DL6bqFqnqaVe%2BRfVgO0afA%40mail.gmail.com
.
Post by Brian Coca
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAHEKYV5ku0dPnR0hexj%3DHY%2B2ZsKiFdzktCWBgDfOD7yKvXy4XQ%40mail.gmail.com
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOMCme4e8G%3DnprsfOuHvrG-Fad8UiBhuSzmL5HxyYkB5JH%3DUvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Mauricio Tavares
2015-07-22 20:09:41 UTC
Permalink
Post by Timothy Appnel
Then you have json (what simplejson became when it was brought in to the
python core). <tim/>
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.
Post by Timothy Appnel
Post by Mauricio Tavares
import json
~ #

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

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


[***@scan ansible]$

it works, but

[***@scan ansible]$ ansible vmhosts -a date
vmhost2.example.com | FAILED >> {
"failed": true,
"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 ***@openssh.com\r\ndebug1:
kex: client->server aes128-ctr hmac-sha1 ***@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-***@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/
Post by Timothy Appnel
/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 ***@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",
"parsed": false
}

[***@scan ansible]$

I then realize I am barking at the wrong tree: the target does not
have the grp module.
Post by Timothy Appnel
Post by Mauricio Tavares
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?
For this specific target,
~ # python -V
Python 2.6.7
~ #
--
Brian Coca
--
You received this message because you are subscribed to the Google
Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kBMXaCZLzar7e7Gi6fxni6DL6bqFqnqaVe%2BRfVgO0afA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAHEKYV5ku0dPnR0hexj%3DHY%2B2ZsKiFdzktCWBgDfOD7yKvXy4XQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAOMCme4e8G%3DnprsfOuHvrG-Fad8UiBhuSzmL5HxyYkB5JH%3DUvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAHEKYV6apXj0n8FH0fEZvHWwPAtYV6R9gAX-urYkCShW%2Bzbozw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...