# Problem with raw connections

**URL:** <https://forum.ansible.com/t/problem-with-raw-connections/11616>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 15, 2012, 1:07pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616 "2012-06-15T13:07:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jno](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jno](https://forum.ansible.com/u/jno)\
**Post date:** [June 15, 2012, 1:07pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/1 "2012-06-15T13:07:34Z")

</div>

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:

---

<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 15, 2012, 1:33pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/2 "2012-06-15T13:33:48Z")

</div>

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.

---

<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 15, 2012, 1:42pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/3 "2012-06-15T13:42:39Z")

</div>

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 🙂

–Michael

---

<div class="post-metadata">

**Author:** ![jno](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jno](https://forum.ansible.com/u/jno)\
**Post date:** [June 15, 2012, 6:01pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/4 "2012-06-15T18:01:04Z")

</div>

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 🙂 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

---

<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 15, 2012, 6:02pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/5 "2012-06-15T18:02:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jno](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jno](https://forum.ansible.com/u/jno)\
**Post date:** [June 15, 2012, 7:14pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/6 "2012-06-15T19:14:30Z")

</div>

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 \>\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"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

---

<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 15, 2012, 7:16pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/7 "2012-06-15T19:16:39Z")

</div>

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

patches welcome (hint, hint)

---

<div class="post-metadata">

**Author:** ![Timothy\_Appnel](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@Timothy\_Appnel](https://forum.ansible.com/u/Timothy_Appnel)\
**Post date:** [June 15, 2012, 7:34pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/8 "2012-06-15T19:34:47Z")

</div>

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.

---

<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 15, 2012, 7:52pm UTC](https://forum.ansible.com/t/problem-with-raw-connections/11616/9 "2012-06-15T19:52:41Z")

</div>

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

– Michael
