ansible/test/playbook-failed_when.yml

16 lines
318 B
YAML
Raw Normal View History

---
- hosts: all
connection: local
gather_facts: False
tasks:
- action: shell exit 0
register: exit
failed_when: not exit.rc in [0, 1]
- action: shell exit 1
register: exit
failed_when: exit.rc not in [0, 1]
- action: shell exit 2
register: exit
failed_when: exit.rc not in [0, 1]