mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Rename set_up and tear_down to pre_tasks and post_tasks
This commit is contained in:
@@ -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 }}'
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user