Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure Ansible to output errors without replaced newlines?

Tags:

ansible

It seems that ansible return results using JSON format, replacing the newlines with \n in the output.

This makes very hard to read the output on the screen / logs. How can I configure it to use real-newlines?

like image 253
sorin Avatar asked Feb 22 '16 17:02

sorin


1 Answers

You need to use the callback plugins in your ansible.cfg file...

[defaults]
(...)
stdout_callback=debug
stderr_callback=debug

Will solve your issue... Don't ask why it's not the default, because I really can't say.

NOTE: This is only available in Ansible 2.0.0 and later.

like image 110
Jack_Hu Avatar answered Dec 06 '22 20:12

Jack_Hu