mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Added a 'set_up' and 'tear_down' which are like tasks, but execute before and after roles.
This commit is contained in:
@@ -25,6 +25,12 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
|
||||
set_up:
|
||||
|
||||
# set up tasks are executed prior to roles.
|
||||
- local_action: shell echo "hi this is a setup step about {{ inventory_hostname }}"
|
||||
|
||||
roles:
|
||||
|
||||
# a role can be listed flat like this:
|
||||
@@ -51,4 +57,11 @@
|
||||
|
||||
- shell: echo 'this is a loose task'
|
||||
|
||||
tear_down:
|
||||
|
||||
# just to provide a syntactic mirroring to 'set_up', tear_down runs dead last in the play.
|
||||
|
||||
- local_action: shell echo 'this is a teardown task about {{ inventory_hostname }}'
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user