Official plugins
You can use the output callback plugins . For example, starting with Ansible 2.4, you can use the debug output callback plugin:
(Alternatively, run export ANSIBLE_STDOUT_CALLBACK=debug before starting your game book)
Important: you must run ansible-playbook with -v ( --verbose ) to see the effect. With stdout_callback = debug output should look something like this:
TASK [Say Hello] ******************************** changed: [192.168.1.2] => { "changed": true, "rc": 0 } STDOUT: Hello! STDERR: Shared connection to 192.168.1.2 closed.
There are other modules besides the debug module if you want the output to be formatted differently. There are json , yaml , unixy , dense , minimal , etc. ( Complete list ).
For example, with stdout_callback = yaml output would look something like this:
TASK [Say Hello] ********************************** changed: [192.168.1.2] => changed=true rc: 0 stderr: |- Shared connection to 192.168.1.2 closed. stderr_lines: - Shared connection to 192.168.1.2 closed. stdout: |2- Hello! stdout_lines: <omitted>
3rd party plugins
If none of the official plugins is satisfactory, you can try the human_log plugin. There are several versions:
Flux Jan 29 '19 at 8:12 2019-01-29 08:12
source share