summaryrefslogtreecommitdiff
path: root/samples/test_block.yml
diff options
context:
space:
mode:
Diffstat (limited to 'samples/test_block.yml')
-rw-r--r--samples/test_block.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/samples/test_block.yml b/samples/test_block.yml
new file mode 100644
index 0000000000..25c9003082
--- /dev/null
+++ b/samples/test_block.yml
@@ -0,0 +1,20 @@
+- hosts: all
+ connection: local
+ 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"