'We merge a \'magic\' var \'groups\' with group name keys and hostname list values into every host variable set. Cache for speed.'

def get_groups_dict(self):

    if (not self._groups_dict_cache):
        for (group_name, group) in iteritems(self.groups):
            self._groups_dict_cache[group_name] = [h.name for h in group.get_hosts()]
    return self._groups_dict_cache
