Load parent groups when processing group_vars

This commit is contained in:
Michael DeHaan 2012-08-14 19:48:33 -04:00
commit 6de8c27085
3 changed files with 15 additions and 2 deletions

View file

@ -226,7 +226,8 @@ class Play(object):
if (host is not None):
inventory = self.playbook.inventory
hostrec = inventory.get_host(host)
groups = [ g.name for g in hostrec.groups ]
groupz = sorted(inventory.groups_for_host(host), key=lambda g: g.depth)
groups = [ g.name for g in groupz ]
basedir = inventory.basedir()
if basedir is not None:
for x in groups: