def _run_sync(context, callback, *args, **kwargs):
    """ runs command for each instance in @all synchronously """
    config = context.obj.config
    logger = context.obj.logger
    results = []
    for instance_name in config.get_instances():
        logger.debug('running {} for instance: {}'.format(context.command.
            name, instance_name))
        config['current_instance'] = instance_name
        config['multi'] = True
        kwargs.update(context.params)
        result = callback(*args, **kwargs)
        results.append(result)
    return results
