summaryrefslogtreecommitdiff
path: root/lib/ansible/executor
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2019-04-16 15:50:52 -0400
committerToshio Kuratomi <a.badger@gmail.com>2019-04-16 15:49:53 -0700
commit28348602f88ad7c19cd5904faa9a466db26b4d3f (patch)
treefb28a40fa4009af5517a266aaca48fea77e87ff4 /lib/ansible/executor
parentffa7eaa7a76a6b3fda6d75cc0b299e1f9b31d30b (diff)
downloadansible-28348602f88ad7c19cd5904faa9a466db26b4d3f.tar.gz
ensure facts marked as unsafe (#55326)
dont rely on plugin layer to do so (cherry picked from commit aa8d23b42f82dd48c5929f7c62e71f2a93861103)
Diffstat (limited to 'lib/ansible/executor')
-rw-r--r--lib/ansible/executor/task_executor.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py
index 234c6deae3..40f0d62fc1 100644
--- a/lib/ansible/executor/task_executor.py
+++ b/lib/ansible/executor/task_executor.py
@@ -692,9 +692,10 @@ class TaskExecutor:
vars_copy.update(result['ansible_facts'])
else:
# TODO: cleaning of facts should eventually become part of taskresults instead of vars
- vars_copy.update(namespace_facts(result['ansible_facts']))
+ af = wrap_var(result['ansible_facts'])
+ vars_copy.update(namespace_facts(af))
if C.INJECT_FACTS_AS_VARS:
- vars_copy.update(clean_facts(result['ansible_facts']))
+ vars_copy.update(clean_facts(af))
# set the failed property if it was missing.
if 'failed' not in result:
@@ -754,9 +755,10 @@ class TaskExecutor:
variables.update(result['ansible_facts'])
else:
# TODO: cleaning of facts should eventually become part of taskresults instead of vars
- variables.update(namespace_facts(result['ansible_facts']))
+ af = wrap_var(result['ansible_facts'])
+ variables.update(namespace_facts(af))
if C.INJECT_FACTS_AS_VARS:
- variables.update(clean_facts(result['ansible_facts']))
+ variables.update(clean_facts(af))
# save the notification target in the result, if it was specified, as
# this task may be running in a loop in which case the notification