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

177 views
Skip to first unread message

Andy Ingham

unread,
May 1, 2014, 4:37:42 PM5/1/14
to ansible...@googlegroups.com
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 >>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You are about to access a Duke University computer network that is intended for
authorized users only. You should have no expectation of privacy in your use of
this network. Use of this network constitutes consent to monitoring, retrieval,
and disclosure of any information stored within the network for any purpose
including criminal prosecution.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


However, when I substitue a different filename I *do not see* the stdout output, even though the command succeeds.

ansible HOSTABC -a 'cat /var/log/boot.log' -K --sudo -v
sudo password: 

HOSTABC | success | rc=0 >>

<STDOUT SHOULD BE *HERE*>


Can anyone shine a light on this for me?

Thanks!
Andy

James Cammarata

unread,
May 1, 2014, 4:48:01 PM5/1/14
to ansible...@googlegroups.com
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.


--
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-proje...@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/af410281-58ea-4123-845c-7c7b25a59065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
May 1, 2014, 5:35:15 PM5/1/14
to ansible...@googlegroups.com
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.




Michael DeHaan

unread,
May 1, 2014, 5:36:13 PM5/1/14
to ansible...@googlegroups.com
I need to swap UNC and Duke in that above joke.   Rraaargh, so much for trying to be funny on the internets :)


Andy Ingham

unread,
May 2, 2014, 11:05:10 AM5/2/14
to ansible...@googlegroups.com
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

Michael DeHaan

unread,
May 2, 2014, 3:03:03 PM5/2/14
to ansible...@googlegroups.com
On Fri, May 2, 2014 at 11:05 AM, Andy Ingham <andy....@alumni.unc.edu> wrote:
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.


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.


Andy Ingham

unread,
May 5, 2014, 9:27:49 AM5/5/14
to ansible...@googlegroups.com
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:

+++++++
WORKS ==>
+++++++
---
- hosts: XYZ
  sudo: yes
  tasks:
    - shell: cat /etc/motd
      register: cat
    - local_action: command echo item
      with_items: cat.stdout_lines

+++++++
FAILS ==>
+++++++
---
- hosts: XYZ
  sudo: yes
  tasks:
    - shell: cat /var/log/boot.log
      register: cat
    - local_action: command echo item
      with_items: cat.stdout_lines

The file contents for the former:


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You are about to access a Duke University computer network that is intended for
authorized users only. You should have no expectation of privacy in your use of
this network. Use of this network constitutes consent to monitoring, retrieval,
and disclosure of any information stored within the network for any purpose
including criminal prosecution.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


The (beginning of the) file contents for the latter (which, as you can see, DOES include special characters):


^[%G            Welcome to ^[[0;36mCentOS^[[0;39m
Starting udev: ^[%G^[[60G[^[[0;32m  OK  ^[[0;39m]^M

...


Andy

PS, I actually considered a job at Wake Forest about two years ago, but decided it was too long of a commute, so declined the interview.  Seriously. 

Michael DeHaan

unread,
May 5, 2014, 11:49:08 PM5/5/14
to ansible...@googlegroups.com
Appreciate the follow up, please make sure this is filed on github and we can take a look.


Thanks!


--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

Andy Ingham

unread,
May 6, 2014, 11:10:22 AM5/6/14
to ansible...@googlegroups.com
Michael --


Andy 

Andy Ingham

unread,
Jun 11, 2014, 2:17:56 PM6/11/14
to ansible...@googlegroups.com
Just to close the loop...ansible 1.6.2 DOES fix this issue for me.

Thanks!

Andy

On Thursday, May 1, 2014 4:37:42 PM UTC-4, Andy Ingham wrote:

Andy Ingham

unread,
Apr 9, 2015, 9:26:23 AM4/9/15
to ansible...@googlegroups.com
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 >>

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    You are about to access a Duke University computer network that is intended for
    authorized users only. You should have no expectation of privacy in your use of
    this network. Use of this network constitutes consent to monitoring, retrieval,
    and disclosure of any information stored within the network for any purpose
    including criminal prosecution.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


CURRENT VERSION:
    ansible --version
    ansible 1.8.4

Andy
Reply all
Reply to author
Forward
0 new messages