Rename set_up and tear_down to pre_tasks and post_tasks

This commit is contained in:
Michael DeHaan
2013-04-20 16:19:01 -04:00
parent d7623d1f91
commit 37789a852a
2 changed files with 19 additions and 16 deletions

View File

@@ -26,10 +26,12 @@
- hosts: all
set_up:
pre_tasks:
# set up tasks are executed prior to roles.
- local_action: shell echo "hi this is a setup step about {{ inventory_hostname }}"
# these tasks are executed prior to roles.
# this might be a good time to signal an outage window or take a host out of a load balanced pool
- local_action: shell echo "hi this is a pre_task step about {{ inventory_hostname }}"
roles:
@@ -53,15 +55,16 @@
tasks:
# you can still have loose tasks/handlers and they will execute after roles
# you can still have loose tasks/handlers and they will execute after roles are applied
- shell: echo 'this is a loose task'
tear_down:
post_tasks:
# just to provide a syntactic mirroring to 'set_up', tear_down runs dead last in the play.
# just to provide a syntactic mirroring to 'pre_tasks', these run absolute last in the play.
# this might be a good time to put a host back in a load balanced pool or end an outage window
- local_action: shell echo 'this is a teardown task about {{ inventory_hostname }}'
- local_action: shell echo 'this is a post_task about {{ inventory_hostname }}'