diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ccc261cfba..d4ee1fd84fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,6 @@ Ansible Changes By Release * New import/include keywords to replace the old bare `include` directives. The use of `static: {yes|no}` on such includes is now deprecated. - Using `import_*` (`import_playbook`, `import_tasks`, `import_role`) directives are static. - Using `include_*` (`include_tasks`, `include_role`) directives are dynamic. -* Added fact namespacing, from now on facts will be available under `ansible_facts` namespace (i.e. `ansible_facts.ansible_os_distribution`). - They will continue to be added into the main namespace directly, but now a configuration toggle to disable this, currently off by default, in the future it will be on by default. This is done to avoid collisions and possible security issues as facts come from the remote targets and they might be compromised. * New `order` play level keyword that allows the user to change the order in which Ansible processes hosts when dispatching tasks. * Users can now set group merge priority for groups of the same depth (parent child relationship), using the new `ansible_group_priority` variable, when values are the same or don't exist it will fallback to the previous sorting by name'. diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 501ac3fdbe2..8aefd2b4997 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -1403,8 +1403,9 @@ NETWORK_GROUP_MODULES: - {key: network_group_modules, section: defaults} type: list yaml: {key: defaults.network_group_modules} -# Deffered to 2.5 #ONLY_NAMESPACE_FACTS: +# Deffered to 2.5 +# FIXME: reenable when we can remove ansible_ prefix from namespaced facts # default: False # description: # - Facts normally get injected as top level variables, this setting prevents that. diff --git a/lib/ansible/vars/manager.py b/lib/ansible/vars/manager.py index 22d6caced03..a29b186db61 100644 --- a/lib/ansible/vars/manager.py +++ b/lib/ansible/vars/manager.py @@ -336,6 +336,7 @@ class VariableManager: # finally, the facts caches for this host, if it exists try: host_facts = wrap_var(self._fact_cache.get(host.name, {})) + # push facts to main namespace all_vars = combine_vars(all_vars, host_facts) except KeyError: