blob: 626fef5e33298cf633fc79322b519e25dc9dfd3c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
- hosts: all
gather_facts: yes
tasks:
- block:
- debug: msg="this is the first task"
- fail:
when: inventory_hostname == "l2"
- debug: msg="only l1 and l3 should see me"
rescue:
- debug: msg="this is the rescue"
- command: /bin/false
- debug: msg="no host should see this run"
always:
- debug: msg="this is the always block, it will always be seen"
when: foo|default('') != "some value"
tags:
- foo
- bar
- debug: msg="you should only see l1 and l3 run this"
|