所以在我的代码中,我有一个任务
- name: cool task
shell: 'touch iamnotcool.txt'
when: me.cool is not defined
我的var看起来像
---
me:
stumped: yes
因此,当我运行任务时,它将返回以下错误
{"failed": true, "msg": "The conditional check 'me.cool' failed. The error was: error while evaluating conditional (me.cool): 'dict object' has no attribute 'cool'.
when: is_installed.rc is defined and is_installed.rc == 0
这不会:when: is_installed.rc is defined
\n
when is_installed.rc == 0