mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
28 lines
1 KiB
YAML
28 lines
1 KiB
YAML
|
---
|
||
|
- hosts: testhost
|
||
|
gather_facts: false
|
||
|
any_errors_fatal: true
|
||
|
tasks:
|
||
|
- block:
|
||
|
- name: initial block debug
|
||
|
debug: msg='any_errors_fatal_block, i execute normally'
|
||
|
|
||
|
- name: EXPECTED FAILURE any_errors_fatal, initial block, bin/false to simulate failure
|
||
|
command: /bin/false
|
||
|
|
||
|
- name: after a task that fails I should never execute
|
||
|
debug:
|
||
|
msg: 'any_errors_fatal_block_post_fail ... i never execute, cause ERROR!'
|
||
|
rescue:
|
||
|
- name: any_errors_fatal_rescue_block debug
|
||
|
debug: msg='any_errors_fatal_rescue_block_start ... I caught an error'
|
||
|
|
||
|
- name: EXPECTED FAILURE any_errors_fatal in rescue block, using bin/false to simulate error
|
||
|
command: /bin/false
|
||
|
|
||
|
- name: any_errors_fatal post debug
|
||
|
debug: msg='any_errors_fatal_rescue_block_post_fail ... I also never execute :-('
|
||
|
always:
|
||
|
- name: any errors fatal always block debug
|
||
|
debug: msg='any_errors_fatal_always_block_start'
|