'create and execute the single task playbook'

def run(self):

    super(AdHocCLI, self).run()
    pattern = to_text(self.args[0], errors='surrogate_or_strict')
    sshpass = None
    becomepass = None
    self.normalize_become_options()
    (sshpass, becomepass) = self.ask_passwords()
    passwords = {'conn_pass': sshpass, 'become_pass': becomepass}
    (loader, inventory, variable_manager) = self._play_prereqs(self.options)
    no_hosts = False
    if (len(inventory.list_hosts()) == 0):
        display.warning('provided    hosts    list    is    empty,    only    localhost    is    available')
        no_hosts = True
    inventory.subset(self.options.subset)
    hosts = inventory.list_hosts(pattern)
    if (len(hosts) == 0):
        if ((no_hosts is False) and self.options.subset):
            raise AnsibleError('Specified    --limit    does    not    match    any    hosts')
        else:
            display.warning('No    hosts    matched,    nothing    to    do')
    if self.options.listhosts:
        display.display(('        hosts    (%d):' % len(hosts)))
        for host in hosts:
            display.display(('                %s' % host))
        return 0
    if ((self.options.module_name in C.MODULE_REQUIRE_ARGS) and (not self.options.module_args)):
        err = ('No    argument    passed    to    %s    module' % self.options.module_name)
        if pattern.endswith('.yml'):
            err = (err + '    (did    you    mean    to    run    ansible-playbook?)')
        raise AnsibleOptionsError(err)
    if (self.options.module_name in ('include', 'include_role')):
        raise AnsibleOptionsError(("'%s'    is    not    a    valid    action    for    ad-hoc    commands" % self.options.module_name))
    for (name, obj) in get_all_plugin_loaders():
        if obj.subdir:
            plugin_path = os.path.join('.', obj.subdir)
            if os.path.isdir(plugin_path):
                obj.add_directory(plugin_path)
    play_ds = self._play_ds(pattern, self.options.seconds, self.options.poll_interval)
    play = Play().load(play_ds, variable_manager=variable_manager, loader=loader)
    if self.callback:
        cb = self.callback
    elif self.options.one_line:
        cb = 'oneline'
    elif (C.DEFAULT_LOAD_CALLBACK_PLUGINS and (C.DEFAULT_STDOUT_CALLBACK != 'default')):
        cb = C.DEFAULT_STDOUT_CALLBACK
    else:
        cb = 'minimal'
    run_tree = False
    if self.options.tree:
        C.DEFAULT_CALLBACK_WHITELIST.append('tree')
        C.TREE_DIR = self.options.tree
        run_tree = True
    self._tqm = None
    try:
        self._tqm = TaskQueueManager(inventory=inventory, variable_manager=variable_manager, loader=loader, options=self.options, passwords=passwords, stdout_callback=cb, run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS, run_tree=run_tree)
        result = self._tqm.run(play)
    finally:
        if self._tqm:
            self._tqm.cleanup()
        if loader:
            loader.cleanup_all_tmp_files()
    return result
