【发布时间】:2015-04-20 10:37:03
【问题描述】:
我想在 ansible 中漂亮地打印一个已注册的对象以帮助调试。我该怎么做?
【问题讨论】:
我想在 ansible 中漂亮地打印一个已注册的对象以帮助调试。我该怎么做?
【问题讨论】:
如果您想控制格式本身,您还可以使用to_nice_yaml and to_nice_json。更多详情here.
【讨论】:
您需要在调试语句中使用 with_dict 和 var=:
- tasks:
- name: build web node
nova_compute:
arguments: xyz
register: os_web_node
- debug: var={{ item }}
with_dict: os_web_node
【讨论】: