mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 12:51:25 -07:00
Track role execution per-host, not overall in the role
Fixes #11863 Fixes #11878
This commit is contained in:
parent
fb5003dbfc
commit
adb9d7e461
5 changed files with 14 additions and 20 deletions
|
@ -205,14 +205,8 @@ class StrategyBase:
|
|||
# lookup the role in the ROLE_CACHE to make sure we're dealing
|
||||
# with the correct object and mark it as executed
|
||||
for (entry, role_obj) in iterator._play.ROLE_CACHE[task_result._task._role._role_name].iteritems():
|
||||
params = task_result._task._role._role_params
|
||||
if task_result._task._role.tags is not None:
|
||||
params['tags'] = task_result._task._role.tags
|
||||
if task_result._task._role.when is not None:
|
||||
params['when'] = task_result._task._role.when
|
||||
hashed_entry = hash_params(params)
|
||||
if entry == hashed_entry:
|
||||
role_obj._had_task_run = True
|
||||
if role_obj._uuid == task_result._task._role._uuid:
|
||||
role_obj._had_task_run[host.name] = True
|
||||
|
||||
ret_results.append(task_result)
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class StrategyModule(StrategyBase):
|
|||
|
||||
# check to see if this task should be skipped, due to it being a member of a
|
||||
# role which has already run (and whether that role allows duplicate execution)
|
||||
if task._role and task._role.has_run():
|
||||
if task._role and task._role.has_run(host):
|
||||
# If there is no metadata, the default behavior is to not allow duplicates,
|
||||
# if there is metadata, check to see if the allow_duplicates flag was set to true
|
||||
if task._role._metadata is None or task._role._metadata and not task._role._metadata.allow_duplicates:
|
||||
|
|
|
@ -170,7 +170,7 @@ class StrategyModule(StrategyBase):
|
|||
|
||||
# check to see if this task should be skipped, due to it being a member of a
|
||||
# role which has already run (and whether that role allows duplicate execution)
|
||||
if task._role and task._role.has_run():
|
||||
if task._role and task._role.has_run(host):
|
||||
# If there is no metadata, the default behavior is to not allow duplicates,
|
||||
# if there is metadata, check to see if the allow_duplicates flag was set to true
|
||||
if task._role._metadata is None or task._role._metadata and not task._role._metadata.allow_duplicates:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue