简单的例子

鉴于:

然后,这些任务总是运行。

- name: This is a conditional task
  module: src=/example/ dest=/example
  when: variable_name 

- name: This is a conditional task
  module: src=/example/ dest=/example
  when: True

此任务永远不会运行。

- name: This is a conditional task
  module: src=/example/ dest=/example
  when: False