mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Group should only return its own variables
Otherwise, a host in two groups, A and B, using a variable defined in group A and all will get the value of all, as B's variables will include the all variable. Partially fixes #1647.
This commit is contained in:
parent
e44b85daba
commit
715d875dcb
1 changed files with 1 additions and 7 deletions
|
@ -57,13 +57,7 @@ class Group(object):
|
||||||
return list(hosts)
|
return list(hosts)
|
||||||
|
|
||||||
def get_variables(self):
|
def get_variables(self):
|
||||||
|
return self.vars.copy()
|
||||||
vars = {}
|
|
||||||
# FIXME: verify this variable override order is what we want
|
|
||||||
for ancestor in self.get_ancestors():
|
|
||||||
vars.update(ancestor.get_variables())
|
|
||||||
vars.update(self.vars)
|
|
||||||
return vars
|
|
||||||
|
|
||||||
def _get_ancestors(self):
|
def _get_ancestors(self):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue