2014-11-14 23:14:08 +01:00
|
|
|
# will use linear strategy by default
|
2015-04-05 08:05:17 +02:00
|
|
|
- hosts: "{{hosts|default('all')}}"
|
2014-11-14 23:14:08 +01:00
|
|
|
#gather_facts: false
|
2015-04-05 08:05:17 +02:00
|
|
|
strategy: "{{strategy|default('linear')}}"
|
2014-11-14 23:14:08 +01:00
|
|
|
vars:
|
|
|
|
play_var: foo
|
|
|
|
test_dict:
|
|
|
|
a: 1
|
|
|
|
b: 2
|
|
|
|
vars_files:
|
|
|
|
- testing/vars.yml
|
|
|
|
tasks:
|
|
|
|
- block:
|
|
|
|
- debug: msg="in block for {{inventory_hostname}} ({{ansible_nodename}}), group_var is {{group_var}}, host var is {{host_var}}"
|
|
|
|
notify: foo
|
|
|
|
- command: hostname
|
|
|
|
register: hostname_result
|
|
|
|
- debug: msg="registered result is {{hostname_result.stdout}}"
|
|
|
|
- command: whoami
|
|
|
|
sudo: true
|
|
|
|
sudo_user: testing
|
|
|
|
- assemble: src=./testing/ dest=/tmp/output.txt remote_src=no
|
|
|
|
- copy: content="hello world\n" dest=/tmp/copy_content.out mode=600
|
2015-04-05 08:05:17 +02:00
|
|
|
#- command: /bin/false
|
|
|
|
# retries: "{{num_retries|default(5)}}"
|
|
|
|
# delay: 1
|
|
|
|
#- debug: msg="you shouldn't see me"
|
2014-11-14 23:14:08 +01:00
|
|
|
rescue:
|
|
|
|
- debug: msg="this is the rescue"
|
|
|
|
- command: /bin/false
|
|
|
|
- debug: msg="you should not see this rescue message"
|
|
|
|
always:
|
|
|
|
- debug: msg="this is the always block, it should always be seen"
|
2015-04-05 08:05:17 +02:00
|
|
|
#- command: /bin/false
|
|
|
|
#- debug: msg="you should not see this always message"
|
2014-11-14 23:14:08 +01:00
|
|
|
|
|
|
|
handlers:
|
|
|
|
- name: foo
|
|
|
|
debug: msg="this is the foo handler"
|
|
|
|
- name: bar
|
|
|
|
debug: msg="this is the bar handler, you should not see this"
|
|
|
|
|