Warm tip: This article is reproduced from serverfault.com, please click

Clean error output in ansible-playbook

发布于 2016-05-11 19:45:44

If any Ansible task fails, there is error output, the playbook will display it newlines escaped '\n'. For tracebacks, spanning multiple lines, this make it very hard to read.

Is there a way to make ansible-playbook to display unescaped error output from shell, pip, gitand other similar tasks?

Questioner
Mikko Ohtamaa
Viewed
0
9,609 2020-10-05 17:42:00

Add stdout_callback=debug and stderr_callback=debug in the defaults section of your ansible.cfg file.

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

This is supported by ansible > 2.0