Problem with raw connections

Hi!

I'm experimenting with Ansible trying to use the raw command to run
"apt-get update && apt-get install python-simplejson" on several hosts
that are running Ubuntu 8.04 from a machine that have Ubuntu 12.04
with Python 2.7.3 and I get the following result back from the Ubuntu
8.04 host:

Sounds like you are using the devel branch. (Reminder: everyone please specify what version of ansible you are using)

I believe the result=results thing was fixed recently, if you haven’t tried the latest development branch as of say, yesterday PM, I would retry it.

If not, please file a bug in the github issue tracker.

Actually this is just broken for the raw module, so yes, make sure you file a ticket.

It’s a one line patch to change “results=” to “result=”, so a great chance to start with Python :slight_smile:

–Michael

Thank you for the quick reply. And yes you were right assuming I was
running from devel, sorry for not mentioning that.
The fix was almost to easy, just one wrong character :slight_smile: After changing
from results to result it works fine! I will file a ticket on that.
Just a quick additional question regarding the raw module? Is it
supposed to write output char by char instead of line by line like the
normal command mode?

//Jon

Character by character? I don’t know what you mean with that.

if it’s splitting the contents or something into arrays of characters or something, no, definitely not.

I'm not sure exactly how to explain it but it looks like it outputs a
long line och characters instead of lines with linebreaks. Like this
output from ls -l /boot first in normal command mode:

mytesthost | success | rc=0 >>
total 18454
-rw-r--r-- 1 root root 420395 2009-09-18 21:02 abi-2.6.24-24-server
-rw-r--r-- 1 root root 74171 2009-09-18 21:02 config-2.6.24-24-
server
drwxr-xr-x 2 root root 1024 2009-10-19 17:17 grub
-rw-r--r-- 1 root root 7567363 2011-10-05 11:19 initrd.img-2.6.24-24-
server
-rw-r--r-- 1 root root 7536605 2011-08-17 13:31 initrd.img-2.6.24-24-
server.bak
drwx------ 2 root root 12288 2009-08-31 12:54 lost+found
-rw-r--r-- 1 root root 103204 2007-09-28 13:03 memtest86+.bin
-rw-r--r-- 1 root root 1163963 2009-09-18 21:02 System.map-2.6.24-24-
server
-rw-r--r-- 1 root root 1932632 2009-09-18 21:02 vmlinuz-2.6.24-24-
server

and then in raw mode:

mytesthost | success >> {
    "stdout": "total 18454\r\n\n-rw-r--r-- 1 root root 420395
2009-09-18 21:02 abi-2.6.24-24-server\r\n\n-rw-r--r-- 1 root root
74171 2009-09-18 21:02 config-2.6.24-24-server\r\n\ndrwxr-xr-x 2 root
root 1024 2009-10-19 17:17 grub\r\n\n-rw-r--r-- 1 root root 7567363
2011-10-05 11:19 initrd.img-2.6.24-24-server\r\n\n-rw-r--r-- 1 root
root 7536605 2011-08-17 13:31 initrd.img-2.6.24-24-server.bak\r\n
\ndrwx------ 2 root root 12288 2009-08-31 12:54 lost+found\r\n\n-rw-
r--r-- 1 root root 103204 2007-09-28 13:03 memtest86+.bin\r\n\n-rw-r--
r-- 1 root root 1163963 2009-09-18 21:02 System.map-2.6.24-24-server\r
\n\n-rw-r--r-- 1 root root 1932632 2009-09-18 21:02 vmlinuz-2.6.24-24-
server\r\n"
}

It's nothing serious, I mean the command is working now, it just looks
a bit weird.

It may also be Ansible on my machine that is not working correctly. I
think I did run both make install, make debian and hacking/env-setup.
What is the best way to completely erase all traces of Ansible and
start all over with a fresh install again?

//Jon

oh all the literal newlines. That can be fixed, I’m sure.

patches welcome (hint, hint)

I saw this too and thought that was the intent of raw. I thought that was the primary difference between raw and shell – one encoded break while another did not.

Nope, not the intent. It is nothing except raw does not require Python, as is explained in the docs.

– Michael