mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +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:
@@ -137,7 +137,12 @@ class ResultProcess(multiprocessing.Process):
|
||||
result_items = [ result._result ]
|
||||
|
||||
for result_item in result_items:
|
||||
if 'add_host' in result_item:
|
||||
if 'include' in result_item:
|
||||
include_variables = result_item.get('include_variables', dict())
|
||||
if 'item' in result_item:
|
||||
include_variables['item'] = result_item['item']
|
||||
self._send_result(('include', result._host, result._task, result_item['include'], include_variables))
|
||||
elif 'add_host' in result_item:
|
||||
# this task added a new host (add_host module)
|
||||
self._send_result(('add_host', result_item))
|
||||
elif 'add_group' in result_item:
|
||||
|
||||
Reference in New Issue
Block a user