Ansible – How to Display Output

ansible

I have a Ansible play for PGBouncer that displays some output from a stats module built into PGBouncer.

My issue is that when Ansible prints the output to the terminal it mangles the newlines. Instead of seeing

----------
| OUTPUT |
----------

I see

----------\n| OUTPUT |\n----------

Does anyone know how to get Ansible to "pretty print" the output?

Best Answer

There isn't a way to do what you want natively in Ansible. You can do this as a workaround:

ansible-playbook ... | sed 's/\\n/\n/g'