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/always_block.yml

28 lines
1.0 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'