|
|
|
@ -603,13 +603,16 @@ class TaskExecutor:
|
|
|
|
# preserve no log
|
|
|
|
# preserve no log
|
|
|
|
result["_ansible_no_log"] = self._play_context.no_log
|
|
|
|
result["_ansible_no_log"] = self._play_context.no_log
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self._task.action not in C._ACTION_WITH_CLEAN_FACTS:
|
|
|
|
|
|
|
|
result = wrap_var(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
|
|
|
|
# or any facts which may have been generated by the module execution
|
|
|
|
if self._task.register:
|
|
|
|
if self._task.register:
|
|
|
|
if not isidentifier(self._task.register):
|
|
|
|
if not isidentifier(self._task.register):
|
|
|
|
raise AnsibleError("Invalid variable name in 'register' specified: '%s'" % self._task.register)
|
|
|
|
raise AnsibleError("Invalid variable name in 'register' specified: '%s'" % self._task.register)
|
|
|
|
|
|
|
|
|
|
|
|
vars_copy[self._task.register] = result = wrap_var(result)
|
|
|
|
vars_copy[self._task.register] = result
|
|
|
|
|
|
|
|
|
|
|
|
if self._task.async_val > 0:
|
|
|
|
if self._task.async_val > 0:
|
|
|
|
if self._task.poll > 0 and not result.get('skipped') and not result.get('failed'):
|
|
|
|
if self._task.poll > 0 and not result.get('skipped') and not result.get('failed'):
|
|
|
|
@ -661,12 +664,15 @@ class TaskExecutor:
|
|
|
|
if 'changed' not in result:
|
|
|
|
if 'changed' not in result:
|
|
|
|
result['changed'] = False
|
|
|
|
result['changed'] = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self._task.action not in C._ACTION_WITH_CLEAN_FACTS:
|
|
|
|
|
|
|
|
result = wrap_var(result)
|
|
|
|
|
|
|
|
|
|
|
|
# re-update the local copy of vars with the registered value, if specified,
|
|
|
|
# re-update the local copy of vars with the registered value, if specified,
|
|
|
|
# or any facts which may have been generated by the module execution
|
|
|
|
# or any facts which may have been generated by the module execution
|
|
|
|
# This gives changed/failed_when access to additional recently modified
|
|
|
|
# This gives changed/failed_when access to additional recently modified
|
|
|
|
# attributes of result
|
|
|
|
# attributes of result
|
|
|
|
if self._task.register:
|
|
|
|
if self._task.register:
|
|
|
|
vars_copy[self._task.register] = result = wrap_var(result)
|
|
|
|
vars_copy[self._task.register] = result
|
|
|
|
|
|
|
|
|
|
|
|
# if we didn't skip this task, use the helpers to evaluate the changed/
|
|
|
|
# if we didn't skip this task, use the helpers to evaluate the changed/
|
|
|
|
# failed_when properties
|
|
|
|
# failed_when properties
|
|
|
|
@ -708,10 +714,13 @@ class TaskExecutor:
|
|
|
|
result['attempts'] = retries - 1
|
|
|
|
result['attempts'] = retries - 1
|
|
|
|
result['failed'] = True
|
|
|
|
result['failed'] = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self._task.action not in C._ACTION_WITH_CLEAN_FACTS:
|
|
|
|
|
|
|
|
result = wrap_var(result)
|
|
|
|
|
|
|
|
|
|
|
|
# do the final update of the local variables here, for both registered
|
|
|
|
# do the final update of the local variables here, for both registered
|
|
|
|
# values and any facts which may have been created
|
|
|
|
# values and any facts which may have been created
|
|
|
|
if self._task.register:
|
|
|
|
if self._task.register:
|
|
|
|
variables[self._task.register] = result = wrap_var(result)
|
|
|
|
variables[self._task.register] = result
|
|
|
|
|
|
|
|
|
|
|
|
if 'ansible_facts' in result and self._task.action not in C._ACTION_DEBUG:
|
|
|
|
if 'ansible_facts' in result and self._task.action not in C._ACTION_DEBUG:
|
|
|
|
if self._task.action in C._ACTION_WITH_CLEAN_FACTS:
|
|
|
|
if self._task.action in C._ACTION_WITH_CLEAN_FACTS:
|
|
|
|
|