本文介绍了清理 ansible-playbook 中的错误输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果任何 Ansible 任务失败,有错误输出,剧本将显示它换行符转义 '\n'.对于跨越多行的回溯,这使得它很难阅读.

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.

有没有办法让 ansible-playbook 显示 shellpipgit 和其他类似任务的未转义错误输出?

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

推荐答案

defaults 部分添加 stdout_callback=debugstderr_callback=debugansible.cfg 文件.

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

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

这是由 ansible 支持的 >2.0

This is supported by ansible > 2.0

这篇关于清理 ansible-playbook 中的错误输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 11:15