command output not registered

22 views
Skip to first unread message

Larry Fast

unread,
Sep 6, 2015, 1:32:57 PM9/6/15
to Ansible Project

In the following example echo_out.stdout is properly populated with "hello"  but cat_testfile.stdout and tail_testfile are both empty.  My real use case is to do a pass/fail test on an external command that dumps it's output to a file.  


    - command: echo hello

      register: echo_out

 

    - command: cat /tmp/testfile

      register: cat_testfile


    - command: tail /tmp/testfile

      register: cat_testfile

Larry Fast

unread,
Sep 6, 2015, 2:34:33 PM9/6/15
to Ansible Project
Resolved.  my testfile (output from my external command) contained control characters that caused Ansible's logging to silently fail.  I'm guessing it was corrupting the JSON output.  The control character was ^[  part of color coding the output.


Reply all
Reply to author
Forward
0 new messages