summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/any_errors_fatal/always_block.yml
blob: 8c6fbffa96a3b567c786ce5f279a51184e02f665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- 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'