【发布时间】:2016-07-29 13:24:14
【问题描述】:
我有多个任务取决于 variable1 的值。我想检查值是否在 {{variable1}} 中,但出现错误:
- name: do something when the value in variable1
command: <command>
when: "'value' in {{variable1}}"
我正在使用 ansible 2.0.2
【问题讨论】:
-
下面的答案对我有用(好吧,我在
assert: ... that: ...中使用它。你看到什么错误?
标签: linux conditional ansible ansible-playbook ansible-2.x