1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/v2/samples/test_block.yml
James Cammarata 4af2d0a907 Reworking v2 play iterator and fixing some other bugs
Still not working quite right:
* dynamic includes are not adding the included tasks yet
* running roles with tags not quite working right
2015-03-04 13:52:31 -06:00

20 lines
565 B
YAML

- 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"