mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Merge branch 'combine_vars' of git://github.com/laggyluke/ansible into exp
Conflicts: lib/ansible/inventory/vars_plugins/group_vars.py lib/ansible/runner/__init__.py lib/ansible/utils/__init__.py test/TestPlayBook.py
This commit is contained in:
commit
7c6341718e
9 changed files with 111 additions and 30 deletions
|
@ -51,12 +51,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)
|
||||
break
|
||||
results = utils.combine_vars(results, data);
|
||||
|
||||
# load vars in inventory_dir/hosts_vars/name_of_host
|
||||
p = os.path.join(basedir, "host_vars/%s" % host.name)
|
||||
|
@ -66,11 +61,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)
|
||||
break
|
||||
results = utils.combine_vars(results, data);
|
||||
|
||||
return results
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue