summaryrefslogtreecommitdiff
path: root/lib/ansible/executor
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2017-03-15 20:12:16 -0400
committerscottb <dharmabumstead@users.noreply.github.com>2017-03-15 17:12:16 -0700
commitdd8d699981249038b6d9d8dda05ea57239a7d2d4 (patch)
tree063e15819800875787f672361a50eebdd50ce45c /lib/ansible/executor
parent12f6beaebdbe00bce570fe8029258707f36eaecb (diff)
downloadansible-dd8d699981249038b6d9d8dda05ea57239a7d2d4.tar.gz
namespace facts (#18445)
* namespace facts always namespace facts, make the polluting of 'main' conditional on config * updated to 2.4 * Update intro_configuration.rst
Diffstat (limited to 'lib/ansible/executor')
-rw-r--r--lib/ansible/executor/task_executor.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py
index c2c87ef5a8..64f8a6c3e1 100644
--- a/lib/ansible/executor/task_executor.py
+++ b/lib/ansible/executor/task_executor.py
@@ -557,7 +557,9 @@ class TaskExecutor:
return failed_when_result
if 'ansible_facts' in result:
- vars_copy.update(result['ansible_facts'])
+ if not C.NAMESPACE_FACTS:
+ vars_copy.update(result['ansible_facts'])
+ vars_copy.update({'ansible_facts': result['ansible_facts']})
# set the failed property if the result has a non-zero rc. This will be
# overridden below if the failed_when property is set
@@ -596,7 +598,9 @@ class TaskExecutor:
variables[self._task.register] = wrap_var(result)
if 'ansible_facts' in result:
- variables.update(result['ansible_facts'])
+ if not C.NAMESPACE_FACTS:
+ variables.update(result['ansible_facts'])
+ variables.update({'ansible_facts': result['ansible_facts']})
# 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