title: How do I get logs/details of ansible-playbook module executions?
body: <p>Say I execute the following.</p>
  
  <pre><code>$ cat test.sh
  #!/bin/bash
  echo Hello World
  exit 0
  
  $ cat Hello.yml
  ---
  
  - hosts: MyTestHost
    tasks:
    - name: Hello yourself
      script: test.sh
  
  
  $ ansible-playbook  Hello.yml
  
  PLAY [MyTestHost] ****************************************************************
  
  GATHERING FACTS ***************************************************************
  ok: [MyTestHost]
  
  TASK: [Hello yourself] ********************************************************
  ok: [MyTestHost]
  
  PLAY RECAP ********************************************************************
  MyTestHost                    : ok=2    changed=0    unreachable=0    failed=0
  
  $
  </code></pre>
  
  <p>I know for sure that it was successful.</p>
  
  <p><strong>Where/how do I see the "Hello World" echo'ed/printed by my script on the remote host (MyTestHost)? Or the return/exit code of script?</strong></p>
  
  <p>My research shows me it would be possible to write a plugin to intercept module execution callbacks or something on those lines and write a log file. I would prefer to not waste my time with that.</p>
  
  <p>E.g. something like the stdout in below (note that I'm running ansible and not ansible-playbook):</p>
  
  <pre><code>$ ansible plabb54 -i /project/plab/svn/plab-maintenance/ansible/plab_hosts.txt -m script -a ./test.sh
  plabb54 | success &gt;&gt; {
      "rc": 0,
      "stderr": "",
      "stdout": "Hello World\n"
  }
  
  $
  </code></pre>