2
有没有办法检查ansible任务中未定义字典键?
所以在我的代码中,我有一个任务 - 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'.