You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/any_errors_fatal/80981.yml

18 lines
499 B
YAML

- hosts: testhost,testhost2
gather_facts: false
any_errors_fatal: true
tasks:
- block:
- fail:
when: inventory_hostname == "testhost"
- name: any_errors_fatal fails all hosts when any of them fails
debug:
msg: SHOULD NOT HAPPEN
rescue:
- name: Rescues both hosts
debug:
msg: rescue
- name: You can recover from fatal errors by adding a rescue section to the block.
debug:
msg: recovered