mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
invalidate group cache so that a group added by the add_host module will be relfected in the groups variable in later plays.
This commit is contained in:
parent
2baece3a03
commit
149f1f9f3c
1 changed files with 1 additions and 0 deletions
|
@ -288,6 +288,7 @@ class Inventory(object):
|
||||||
|
|
||||||
def add_group(self, group):
|
def add_group(self, group):
|
||||||
self.groups.append(group)
|
self.groups.append(group)
|
||||||
|
self._groups_list = None # invalidate internal cache
|
||||||
|
|
||||||
def list_hosts(self, pattern="all"):
|
def list_hosts(self, pattern="all"):
|
||||||
return [ h.name for h in self.get_hosts(pattern) ]
|
return [ h.name for h in self.get_hosts(pattern) ]
|
||||||
|
|
Loading…
Reference in a new issue