mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Loose tasks not in roles get executed after roles.
This commit is contained in:
parent
f044fc344b
commit
fffb1a0a9d
2 changed files with 13 additions and 7 deletions
|
@ -45,3 +45,10 @@
|
||||||
# explicit tasks and handlers can be used, but are not required.
|
# explicit tasks and handlers can be used, but are not required.
|
||||||
# they will run after the roles if present.
|
# they will run after the roles if present.
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
# you can still have loose tasks/handlers and they will execute after roles
|
||||||
|
|
||||||
|
- shell: echo 'this is a loose task'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -166,13 +166,12 @@ class Play(object):
|
||||||
handlers = []
|
handlers = []
|
||||||
if type(vars_files) != list:
|
if type(vars_files) != list:
|
||||||
vars_files = []
|
vars_files = []
|
||||||
tasks.extend(new_tasks)
|
new_tasks.extend(tasks)
|
||||||
handlers.extend(new_handlers)
|
new_handlers.extend(handlers)
|
||||||
|
new_vars_files.extend(vars_files)
|
||||||
vars_files.extend(new_vars_files)
|
ds['tasks'] = new_tasks
|
||||||
ds['tasks'] = tasks
|
ds['handlers'] = new_handlers
|
||||||
ds['handlers'] = handlers
|
ds['vars_files'] = new_vars_files
|
||||||
ds['vars_files'] = vars_files
|
|
||||||
|
|
||||||
return ds
|
return ds
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue