'Loads an included YAML file of tasks, applying the optional set of variables.'

def _load_included_file(self, included_file, iterator, is_handler=False):

    display.debug(('loading    included    file:    %s' % included_file._filename))
    try:
        data = self._loader.load_from_file(included_file._filename)
        if (data is None):
            return []
        elif (not isinstance(data, list)):
            raise AnsibleError('included    task    files    must    contain    a    list    of    tasks')
        ti_copy = included_file._task.copy()
        temp_vars = ti_copy.vars.copy()
        temp_vars.update(included_file._args)
        tags = included_file._task.vars.pop('tags', [])
        if isinstance(tags, string_types):
            tags = tags.split(',')
        if (len(tags) > 0):
            if (len(included_file._task.tags) > 0):
                raise AnsibleParserError('Include    tasks    should    not    specify    tags    in    more    than    one    way    (both    via    args    and    directly    on    the    task).    Mixing    tag    specify    styles    is    prohibited    for    whole    import    hierarchy,    not    only    for    single    import    statement', obj=included_file._task._ds)
            display.deprecated('You    should    not    specify    tags    in    the    include    parameters.    All    tags    should    be    specified    using    the    task-level    option')
            included_file._task.tags = tags
        ti_copy.vars = temp_vars
        block_list = load_list_of_blocks(data, play=iterator._play, parent_block=None, task_include=ti_copy, role=included_file._task._role, use_handlers=is_handler, loader=self._loader, variable_manager=self._variable_manager)
        for host in included_file._hosts:
            self._tqm._stats.increment('ok', host.name)
    except AnsibleError as e:
        for host in included_file._hosts:
            tr = TaskResult(host=host, task=included_file._task, return_data=dict(failed=True, reason=to_text(e)))
            iterator.mark_host_failed(host)
            self._tqm._failed_hosts[host.name] = True
            self._tqm._stats.increment('failures', host.name)
            self._tqm.send_callback('v2_runner_on_failed', tr)
        return []
    self._tqm.send_callback('v2_playbook_on_include', included_file)
    display.debug('done    processing    included    file')
    return block_list
