{{ cat }}'s docs

1.6.3: LOGIC-faied when

1. failed_when用法

# 1. 简单用法
  failed_when: result.failed

# 2. 多个条件 and 关系
  failed_when: "'docker.service' in ansible_facts.services" and docker_bin.stat.exists
# 或者
  failed_when:
    - "'docker.service' in ansible_facts.services"
    - docker_bin.stat.exists

# 3. 多个条件 or 关系
  failed_when: "'docker.service' in ansible_facts.services" or docker_bin.stat.exists
# 或者
  failed_when: >
    ('docker.service' in ansible_facts.services) or
    (docker_bin.stat.exists)

Contents