mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
V2 fixing bugs
This commit is contained in:
@@ -237,10 +237,14 @@ class TaskExecutor:
|
||||
if self._task.poll > 0:
|
||||
result = self._poll_async_result(result=result)
|
||||
|
||||
# update the local copy of vars with the registered value, if specified
|
||||
# update the local copy of vars with the registered value, if specified,
|
||||
# or any facts which may have been generated by the module execution
|
||||
if self._task.register:
|
||||
vars_copy[self._task.register] = result
|
||||
|
||||
if 'ansible_facts' in result:
|
||||
vars_copy.update(result['ansible_facts'])
|
||||
|
||||
# create a conditional object to evaluate task conditions
|
||||
cond = Conditional(loader=self._loader)
|
||||
|
||||
@@ -266,6 +270,15 @@ class TaskExecutor:
|
||||
if attempt < retries - 1:
|
||||
time.sleep(delay)
|
||||
|
||||
# do the final update of the local variables here, for both registered
|
||||
# values and any facts which may have been created
|
||||
if self._task.register:
|
||||
variables[self._task.register] = result
|
||||
|
||||
if 'ansible_facts' in result:
|
||||
variables.update(result['ansible_facts'])
|
||||
|
||||
# and return
|
||||
debug("attempt loop complete, returning result")
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user