mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
namespace facts
updated action plugins to use new guranteed facts updated tests to new data clean added cases for ansible_local and some docstrings
This commit is contained in:
parent
e0cb54a2aa
commit
db749de5b8
15 changed files with 236 additions and 175 deletions
|
@ -33,6 +33,7 @@ from ansible.plugins.connection import ConnectionBase
|
|||
from ansible.template import Templar
|
||||
from ansible.utils.listify import listify_lookup_plugin_terms
|
||||
from ansible.utils.unsafe_proxy import UnsafeProxy, wrap_var
|
||||
from ansible.vars.clean import namespace_facts, clean_facts
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
|
@ -574,7 +575,9 @@ class TaskExecutor:
|
|||
return failed_when_result
|
||||
|
||||
if 'ansible_facts' in result:
|
||||
vars_copy.update(result['ansible_facts'])
|
||||
vars_copy.update(namespace_facts(result['ansible_facts']))
|
||||
if C.INJECT_FACTS_AS_VARS:
|
||||
vars_copy.update(clean_facts(result['ansible_facts']))
|
||||
|
||||
# set the failed property if it was missing.
|
||||
if 'failed' not in result:
|
||||
|
@ -620,7 +623,9 @@ class TaskExecutor:
|
|||
variables[self._task.register] = wrap_var(result)
|
||||
|
||||
if 'ansible_facts' in result:
|
||||
variables.update(result['ansible_facts'])
|
||||
variables.update(namespace_facts(result['ansible_facts']))
|
||||
if C.INJECT_FACTS_AS_VARS:
|
||||
variables.update(clean_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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue