mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-11 03:31:29 -07:00
Tweaked merge_hash to also affect Runner behavior
This commit is contained in:
parent
94d189bc7f
commit
6826aa7360
9 changed files with 110 additions and 23 deletions
|
@ -49,11 +49,7 @@ class VarsModule(object):
|
|||
data = utils.parse_yaml_from_file(path)
|
||||
if type(data) != dict:
|
||||
raise errors.AnsibleError("%s must be stored as a dictionary/hash" % path)
|
||||
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
|
||||
# let data content override results if needed
|
||||
results = utils.merge_hash(results, data)
|
||||
else:
|
||||
results.update(data)
|
||||
results = utils.combine_vars(results, data);
|
||||
|
||||
# load vars in inventory_dir/hosts_vars/name_of_host
|
||||
path = os.path.join(basedir, "host_vars/%s" % host.name)
|
||||
|
@ -61,10 +57,6 @@ class VarsModule(object):
|
|||
data = utils.parse_yaml_from_file(path)
|
||||
if type(data) != dict:
|
||||
raise errors.AnsibleError("%s must be stored as a dictionary/hash" % path)
|
||||
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
|
||||
# let data content override results if needed
|
||||
results = utils.merge_hash(results, data)
|
||||
else:
|
||||
results.update(data)
|
||||
results = utils.combine_vars(results, data);
|
||||
return results
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue