mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
565 B
YAML
21 lines
565 B
YAML
10 years ago
|
- hosts: all
|
||
10 years ago
|
connection: local
|
||
10 years ago
|
gather_facts: yes
|
||
10 years ago
|
tasks:
|
||
|
- block:
|
||
10 years ago
|
- debug: msg="this is the first task"
|
||
|
- fail:
|
||
|
when: inventory_hostname == "l2"
|
||
|
- debug: msg="only l1 and l3 should see me"
|
||
10 years ago
|
rescue:
|
||
|
- debug: msg="this is the rescue"
|
||
|
- command: /bin/false
|
||
10 years ago
|
- debug: msg="no host should see this run"
|
||
10 years ago
|
always:
|
||
|
- debug: msg="this is the always block, it will always be seen"
|
||
|
when: foo|default('') != "some value"
|
||
|
tags:
|
||
|
- foo
|
||
|
- bar
|
||
10 years ago
|
- debug: msg="you should only see l1 and l3 run this"
|