# why isn't stdout returned on this most basic of commands?

**URL:** <https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138>\
**Category:** Ansible Project\
**Created:** [May 1, 2014, 8:37pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138 "2014-05-01T20:37:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Ingham](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andy\_Ingham](https://forum.ansible.com/u/Andy_Ingham)\
**Post date:** [May 1, 2014, 8:37pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/1 "2014-05-01T20:37:42Z")

</div>

This one baffles me.

I issue this command:

ansible HOSTABC -a ‘cat /etc/motd’ -K --sudo -v  
sudo password:

and I see the success message PLUS the stdout of that file

HOSTABC | success | rc=0 \>\>

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [May 1, 2014, 8:48pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/2 "2014-05-01T20:48:01Z")

</div>

What version of ansible are you running? There were some issues in parsing the stdout of some commands when unicode characters were contained in it, however that has been fixed in devel for a couple of weeks.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 1, 2014, 9:35pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/3 "2014-05-01T21:35:15Z")

</div>

I know why! I know why!

You are a Duke alumni attempting to access a UNC computer network.

As a Wolfpacker, I endorse any civil war that may ensue and result in the demise of both athletic franchises.

That all being said, that’s not normal, let us know your version info. Depending on results we may have another command or two for you to run.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 1, 2014, 9:36pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/4 "2014-05-01T21:36:13Z")

</div>

I need to swap UNC and Duke in that above joke. Rraaargh, so much for trying to be funny on the internets 🙂

---

<div class="post-metadata">

**Author:** ![Andy\_Ingham](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andy\_Ingham](https://forum.ansible.com/u/Andy_Ingham)\
**Post date:** [May 2, 2014, 3:05pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/5 "2014-05-02T15:05:10Z")

</div>

Michael / James –

Thanks for the quick reply. I’m using ansible 1.5.3-1.el6

BTW, Michael, I also have connections to NCSU. I’m the only person I know that has worked full-time for at least a year at all three of: UNC, Duke, and State. I did enjoy your jab, though.

Best wishes,  
Andy

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 2, 2014, 7:03pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/6 "2014-05-02T19:03:03Z")

</div>

You need to get some Wake Forrest in there.

I think we'd be interested in the file contents (in case this matters) and  
if you can make a playbook to reproduce things we could test.

---

<div class="post-metadata">

**Author:** ![Andy\_Ingham](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andy\_Ingham](https://forum.ansible.com/u/Andy_Ingham)\
**Post date:** [May 5, 2014, 1:27pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/7 "2014-05-05T13:27:49Z")

</div>

Michael –

(Note that as of this morning, I am at version 1.5.5-1.el6 of ansible, and still seeing the same issue – FYI)

The simplest of playbooks to show the error:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 6, 2014, 3:49am UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/8 "2014-05-06T03:49:08Z")

</div>

Appreciate the follow up, please make sure this is filed on github and we can take a look.

[github.com/ansible/ansible](http://github.com/ansible/ansible).

Thanks!

---

<div class="post-metadata">

**Author:** ![Andy\_Ingham](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andy\_Ingham](https://forum.ansible.com/u/Andy_Ingham)\
**Post date:** [May 6, 2014, 3:10pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/9 "2014-05-06T15:10:22Z")

</div>

> Michael –

Just created at github ==\> [https://github.com/ansible/ansible/issues/7299](https://github.com/ansible/ansible/issues/7299)

Andy

---

<div class="post-metadata">

**Author:** ![Andy\_Ingham](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andy\_Ingham](https://forum.ansible.com/u/Andy_Ingham)\
**Post date:** [June 11, 2014, 6:17pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/10 "2014-06-11T18:17:56Z")

</div>

Just to close the loop…ansible 1.6.2 DOES fix this issue for me.

Thanks!

Andy

---

<div class="post-metadata">

**Author:** ![Andy\_Ingham](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Andy\_Ingham](https://forum.ansible.com/u/Andy_Ingham)\
**Post date:** [April 9, 2015, 1:26pm UTC](https://forum.ansible.com/t/why-isnt-stdout-returned-on-this-most-basic-of-commands/15138/11 "2015-04-09T13:26:23Z")

</div>

Unfortunately, this problem has returned (as of version 1.8.4 ?):

FAILS:

ansible HOSTXYZ -m shell -a ‘cat /var/log/boot.log’ -K --sudo  
sudo password:  
HOSTXYZ | success | rc=0 \>\>

\<NO OUTPUT HERE, WHERE THERE SHOULD BE (DUE TO SPECIAL CHARACTERS AT THE BEGINNING OF THAT FILE?)\>

WORKS PROPERLY:

ansible HOSTXYZ -m shell -a ‘cat /etc/motd’ -K --sudo  
sudo password:  
HOSTXYZ | success | rc=0 \>\>
