mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Making task includes dynamic and fixing many other bugs
Dynamic task includes still need some work, this is a rough first version. * doesn't work with handler sections of playbooks yet * when using include + with*, the insertion order is backwards * fix potential for task lists to be unsynchronized when using the linear strategy, as the include conditional could be predicated on an inventory variable
This commit is contained in:
@@ -186,6 +186,14 @@ class TaskExecutor:
|
||||
# Now we do final validation on the task, which sets all fields to their final values
|
||||
self._task.post_validate(variables)
|
||||
|
||||
# if this task is a TaskInclude, we just return now with a success code so the
|
||||
# main thread can expand the task list for the given host
|
||||
if self._task.action == 'include':
|
||||
include_variables = self._task.args.copy()
|
||||
include_file = include_variables.get('_raw_params')
|
||||
del include_variables['_raw_params']
|
||||
return dict(changed=True, include=include_file, include_variables=include_variables)
|
||||
|
||||
# And filter out any fields which were set to default(omit), and got the omit token value
|
||||
omit_token = variables.get('omit')
|
||||
if omit_token is not None:
|
||||
@@ -204,7 +212,6 @@ class TaskExecutor:
|
||||
# with the registered variable value later on when testing conditions
|
||||
vars_copy = variables.copy()
|
||||
|
||||
|
||||
debug("starting attempt loop")
|
||||
result = None
|
||||
for attempt in range(retries):
|
||||
|
||||
Reference in New Issue
Block a user