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.
pull/29174/merge
Brian Coca 7 years ago
parent 8f050d3719
commit 0c291ece1a

@ -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'.

@ -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.

@ -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:

Loading…
Cancel
Save