'Blocks do not store variables directly, however they may be a member
of a role or task include which does, so return those if present.'

def get_vars(self):

    all_vars = self.vars.copy()
    if self._parent:
        all_vars.update(self._parent.get_vars())
    return all_vars
