remove fact namespacing

since we want to make namespaced facts drop ansible_ prefix but don't have the
time before release to perfect this feature, we are going to postpone it for now
until we have the resources to fix this issue. That way we won't have people relying
on the 'incorrect' names for a release.
This commit is contained in:
Brian Coca 2017-08-22 11:39:35 -04:00
parent 8f050d3719
commit 0c291ece1a
3 changed files with 3 additions and 3 deletions

View file

@ -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. * 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 `import_*` (`import_playbook`, `import_tasks`, `import_role`) directives are static.
- Using `include_*` (`include_tasks`, `include_role`) directives are dynamic. - 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. 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. * 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'. * 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'.

View file

@ -1403,8 +1403,9 @@ NETWORK_GROUP_MODULES:
- {key: network_group_modules, section: defaults} - {key: network_group_modules, section: defaults}
type: list type: list
yaml: {key: defaults.network_group_modules} yaml: {key: defaults.network_group_modules}
# Deffered to 2.5
#ONLY_NAMESPACE_FACTS: #ONLY_NAMESPACE_FACTS:
# Deffered to 2.5
# FIXME: reenable when we can remove ansible_ prefix from namespaced facts
# default: False # default: False
# description: # description:
# - Facts normally get injected as top level variables, this setting prevents that. # - Facts normally get injected as top level variables, this setting prevents that.

View file

@ -336,6 +336,7 @@ class VariableManager:
# finally, the facts caches for this host, if it exists # finally, the facts caches for this host, if it exists
try: try:
host_facts = wrap_var(self._fact_cache.get(host.name, {})) host_facts = wrap_var(self._fact_cache.get(host.name, {}))
# push facts to main namespace # push facts to main namespace
all_vars = combine_vars(all_vars, host_facts) all_vars = combine_vars(all_vars, host_facts)
except KeyError: except KeyError: