Skip to content

Commit

Permalink
Avoid 2nd processing of facts for actions
Browse files Browse the repository at this point in the history
include_vars and set_fact are already updating hostvars in strategy
no need to 're add again' with lower priority the same data.

fixes ansible#37535, mostly by avoiding reprocessing and 'cleaning'
  • Loading branch information
bcoca committed Mar 16, 2018
1 parent 93d2761 commit d97231f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/executor/task_executor.py
Expand Up @@ -593,7 +593,7 @@ def _evaluate_failed_when_result(result):
failed_when_result = False
return failed_when_result

if 'ansible_facts' in result:
if 'ansible_facts' in result and self._task.action not in ('set_fact', 'include_vars'):
vars_copy.update(namespace_facts(result['ansible_facts']))
if C.INJECT_FACTS_AS_VARS:
vars_copy.update(clean_facts(result['ansible_facts']))
Expand Down Expand Up @@ -651,7 +651,7 @@ def _evaluate_failed_when_result(result):
if self._task.register:
variables[self._task.register] = wrap_var(result)

if 'ansible_facts' in result:
if 'ansible_facts' in result and self._task.action not in ('set_fact', 'include_vars'):
variables.update(namespace_facts(result['ansible_facts']))
if C.INJECT_FACTS_AS_VARS:
variables.update(clean_facts(result['ansible_facts']))
Expand Down

0 comments on commit d97231f

Please sign in to comment.