如果需要的变量没有定义,那么可以skip或者使用jinja2的defined如下所示:
|
---
- name: echo variable
when:
- api_interface is defined
- neutron_external_interface is defined
- storage_interface is undefined
pause: seconds=10
参考:https://blog.csdn.net/kellyseeme/article/details/50609591