mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Merge branch 'custom-facts' of https://github.com/jhoekx/ansible into jhoekx-custom-facts
Conflicts: lib/ansible/runner.py
This commit is contained in:
commit
49cca98f1e
6 changed files with 30 additions and 13 deletions
|
@ -320,9 +320,9 @@ class Runner(object):
|
|||
''' allows discovered variables to be used in templates and action statements '''
|
||||
|
||||
host = conn.host
|
||||
try:
|
||||
var_result = utils.parse_json(result)
|
||||
except:
|
||||
if 'ansible_facts' in result:
|
||||
var_result = result['ansible_facts']
|
||||
else:
|
||||
var_result = {}
|
||||
|
||||
# note: do not allow variables from playbook to be stomped on
|
||||
|
@ -349,10 +349,12 @@ class Runner(object):
|
|||
|
||||
if module_name == 'setup':
|
||||
self._add_result_to_setup_cache(conn, result)
|
||||
if self.is_playbook:
|
||||
self._save_setup_result_to_disk(conn, result)
|
||||
(host, ok, data, err) = self._return_from_module(conn, host, result, err, executed)
|
||||
|
||||
return self._return_from_module(conn, host, result, err, executed)
|
||||
if ok:
|
||||
self._add_result_to_setup_cache(conn, data)
|
||||
|
||||
return (host, ok, data, err)
|
||||
|
||||
# *****************************************************
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue