Pass the top level dictionaries to combine_vars (#72979)
* Pass the top level dictionaries to combine_vars combine_vars uses dict.update() to replace keys
This commit is contained in:
parent
6487a239c0
commit
5e03e322de
3 changed files with 4 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- inventory - pass the vars dictionary to combine_vars instead of an individual key's value (https://github.com/ansible/ansible/issues/72975).
|
|
@ -247,7 +247,7 @@ class Group:
|
||||||
self.set_priority(int(value))
|
self.set_priority(int(value))
|
||||||
else:
|
else:
|
||||||
if key in self.vars and isinstance(self.vars[key], MutableMapping) and isinstance(value, Mapping):
|
if key in self.vars and isinstance(self.vars[key], MutableMapping) and isinstance(value, Mapping):
|
||||||
self.vars[key] = combine_vars(self.vars[key], value)
|
self.vars = combine_vars(self.vars, {key: value})
|
||||||
else:
|
else:
|
||||||
self.vars[key] = value
|
self.vars[key] = value
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ class Host:
|
||||||
|
|
||||||
def set_variable(self, key, value):
|
def set_variable(self, key, value):
|
||||||
if key in self.vars and isinstance(self.vars[key], MutableMapping) and isinstance(value, Mapping):
|
if key in self.vars and isinstance(self.vars[key], MutableMapping) and isinstance(value, Mapping):
|
||||||
self.vars[key] = combine_vars(self.vars[key], value)
|
self.vars = combine_vars(self.vars, {key: value})
|
||||||
else:
|
else:
|
||||||
self.vars[key] = value
|
self.vars[key] = value
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue