I want to pretty print a registered object in ansible to help with debugging. How do I do it?
You also have to_nice_yaml
and to_nice_json
if you want to control the format itself. More details here.
You need to use with_dict and var= in your debug statement:
- tasks:
- name: build web node
nova_compute:
arguments: xyz
register: os_web_node
- debug: var={{ item }}
with_dict: os_web_node
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With