V2 fixing bugs

This commit is contained in:
James Cammarata 2015-03-25 13:51:40 -05:00
commit 785c0c0c8c
34 changed files with 505 additions and 426 deletions

View file

@ -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