-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathblock.yml
37 lines (30 loc) · 847 Bytes
/
block.yml
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
28
29
30
31
32
33
34
35
36
37
---
- name: try blocks
hosts: servera.lab.example.com
gather_facts: false
tasks:
- block:
- name: fail intentionally
ansible.builtin.fail:
msg: this is a failure for testing
- name: task1 in block
ansible.builtin.debug:
msg: task1 in block
- name: task2 in block
ansible.builtin.debug:
msg: task2 in block
rescue:
- name: task1 in rescue
ansible.builtin.debug:
msg: task1 in rescue
- name: task2 in rescue
ansible.builtin.debug:
msg: task2 in rescue
always:
- name: task1 in always
ansible.builtin.debug:
msg: task1 in always
- name: task2 in always
ansible.builtin.debug:
msg: task2 in always
...