'sets a varible for an inventory object'

def set_variable(self, entity, varname, value):

    if (entity in self.groups):
        inv_object = self.groups[entity]
    elif (entity in self.hosts):
        inv_object = self.hosts[entity]
    else:
        raise AnsibleError(('Could    not    identify    group    or    host    named    %s' % entity))
    inv_object.set_variable(varname, value)
    display.debug(('set    %s    for    %s' % (varname, entity)))
