4
我想漂亮地打印一个注册对象,以帮助调试。我该怎么做?我怎样才能打印一个对象?
我想漂亮地打印一个注册对象,以帮助调试。我该怎么做?我怎样才能打印一个对象?
您需要使用with_dict和VAR =在您的调试声明:
- tasks:
- name: build web node
nova_compute:
arguments: xyz
register: os_web_node
- debug: var={{ item }}
with_dict: os_web_node
你也有to_nice_yaml
and to_nice_json
,如果你想控制本身的格式。更多详情here。