Executes ``ansible-playbook`` against the create playbook and returns
        None.

        :return: None
779619
def create(self):
        
        pb = self._get_ansible_playbook(self.playbooks.create)
        pb.execute()
778492
def syntax(self):
        
        pb = self._get_ansible_playbook(self.playbooks.converge)
        pb.add_cli_arg('syntax-check', True)
        pb.execute()
1328802
def do_execute(self):
        
        generator = datagen.DataGenerator.make_copy(self.resolve_option("setup"))
        generator.dataset_format = generator.define_data_format()
        if bool(self.resolve_option("incremental")) and generator.single_mode_flag:
            for i in range(generator.num_examples_act):
                self._output.append(Token(generator.generate_example()))
        else:
            data = generator.generate_examples()
            self._output.append(Token(data))
        return None
84875
def execute(asynchronous: bool = False):
    
    r = Response()
    r.update(server=server_runner.get_server_data())

    cmd, args = parse_command_args(r)
    if r.failed:
        return flask.jsonify(r.serialize())

    try:
        commander.execute(cmd, args, r)
        if not r.thread:
            return flask.jsonify(r.serialize())

        if not asynchronous:
            r.thread.join()

        server_runner.active_execution_responses[r.thread.uid] = r

        # Watch the thread for a bit to see if the command finishes in
        # that time. If it does the command result will be returned directly
        # to the caller. Otherwise, a waiting command will be issued
        count = 0
        while count < 5:
            count += 1
            r.thread.join(0.25)
            if not r.thread.is_alive():
                break

        if r.thread.is_alive():
            return flask.jsonify(
                Response()
                .update(
                    run_log=r.get_thread_log(),
                    run_status='running',
                    run_uid=r.thread.uid,
                    step_changes=server_runner.get_running_step_changes(True),
                    server=server_runner.get_server_data()
                )
                .serialize()
            )

        del server_runner.active_execution_responses[r.thread.uid]
        r.update(
            run_log=r.get_thread_log(),
            run_status='complete',
            run_multiple_updates=False,
            run_uid=r.thread.uid
        )
    except Exception as err:
        r.fail(
            code='KERNEL_EXECUTION_FAILURE',
            message='Unable to execute command',
            cmd=cmd,
            args=args,
            error=err
        )

    return flask.jsonify(r.serialize())
28240
def execute(self):
        

        role_name = self._command_args['role_name']
        role_directory = os.getcwd()
        msg = 'Initializing new role {}...'.format(role_name)
        LOG.info(msg)

        if os.path.isdir(role_name):
            msg = ('The directory {} exists. '
                   'Cannot create new role.').format(role_name)
            util.sysexit_with_message(msg)

        template_directory = ''
        if 'template' in self._command_args.keys():
            template_directory = self._command_args['template']
        else:
            template_directory = 'role'
        self._process_templates(template_directory, self._command_args,
                                role_directory)
        scenario_base_directory = os.path.join(role_directory, role_name)
        templates = [
            'scenario/driver/{driver_name}'.format(**self._command_args),
            'scenario/verifier/{verifier_name}'.format(**self._command_args),
        ]
        for template in templates:
            self._process_templates(template, self._command_args,
                                    scenario_base_directory)
        self._process_templates('molecule', self._command_args, role_directory)

        role_directory = os.path.join(role_directory, role_name)
        msg = 'Initialized role in {} successfully.'.format(role_directory)
        LOG.success(msg)
159653
def do_execute(self):
        
        formatstr = str(self.resolve_option("format"))
        expanded = self.storagehandler.expand(formatstr)
        self._output.append(Token(expanded))
        return None
352081
def callPlaybook(self, playbook, ansibleArgs, wait=True, tags=["all"]):
        
        playbook = os.path.join(self.playbooks, playbook)  # Path to playbook being executed
        verbosity = "-vvvvv" if logger.isEnabledFor(logging.DEBUG) else "-v"
        command = ["ansible-playbook", verbosity, "--tags", ",".join(tags), "--extra-vars"]
        command.append(" ".join(["=".join(i) for i in ansibleArgs.items()]))  # Arguments being passed to playbook
        command.append(playbook)

        logger.debug("Executing Ansible call `%s`", " ".join(command))
        p = subprocess.Popen(command)
        if wait:
            p.communicate()
            if p.returncode != 0:
                # FIXME: parse error codes
                raise RuntimeError("Ansible reported an error when executing playbook %s" % playbook)
1218808
def execute(self):
        
        self.print_info()

        if not self._config.provisioner.playbooks.cleanup:
            msg = 'Skipping, cleanup playbook not configured.'
            LOG.warn(msg)
            return

        self._config.provisioner.cleanup()
1169619
def prepare(self):
        
        pb = self._get_ansible_playbook(self.playbooks.prepare)
        pb.execute()
286547
def _run_play(self, play):
        '''  '''

        self.callbacks.on_play_start(play.name)
        # if no hosts matches this play, drop out
        if not self.inventory.list_hosts(play.hosts):
            self.callbacks.on_no_hosts_matched()
            return True

        # get facts from system
        self._do_setup_step(play)

        # now with that data, handle contentional variable file imports!

        all_hosts = self._list_available_hosts(play.hosts)
        play.update_vars_files(all_hosts)

        serialized_batch = []
        if play.serial <= 0:
            serialized_batch = [all_hosts]
        else:
            # do N forks all the way through before moving to next
            while len(all_hosts) > 0:
                play_hosts = []
                for x in range(play.serial):
                    if len(all_hosts) > 0:
                        play_hosts.append(all_hosts.pop())
                serialized_batch.append(play_hosts)

        for on_hosts in serialized_batch:

            self.inventory.also_restrict_to(on_hosts)

            for task in play.tasks():

                # only run the task if the requested tags match
                should_run = False
                for x in self.only_tags:
                    for y in task.tags:
                        if (x==y):
                            should_run = True
                            break
                if should_run:
                    if not self._run_task(play, task, False):
                        # whether no hosts matched is fatal or not depends if it was on the initial step.
                        # if we got exactly no hosts on the first step (setup!) then the host group
                        # just didn't match anything and that's ok
                        return False

                host_list = self._list_available_hosts(play.hosts)

                # if no hosts remain, drop out
                if not host_list:
                    self.callbacks.on_no_hosts_remaining()
                    return False

            # run notify actions
            for handler in play.handlers():
                if len(handler.notified_by) > 0:
                    self.inventory.restrict_to(handler.notified_by)
                    self._run_task(play, handler, True)
                    self.inventory.lift_restriction()
                    handler.notified_by = []

            self.inventory.lift_also_restriction()

        return True
822746
def _execute(self, operation):  # type: (Operation) -> None
        
        method = operation.job_type

        getattr(self, "_execute_{}".format(method))(operation)
696388
def execute(self):
        
        c = self._config
        if ((not c.state.created) and c.driver.managed):
            msg = 'Instances not created.  Please create instances first.'
            util.sysexit_with_message(msg)

        hosts = [d['name'] for d in self._config.platforms.instances]
        hostname = self._get_hostname(hosts)
        self._get_login(hostname)
400242
def run(self):
        '''  '''

        # find hosts that match the pattern
        hosts = self.inventory.list_hosts(self.pattern)
        if len(hosts) == 0:
            self.callbacks.on_no_hosts()
            return dict(contacted={}, dark={})

        global multiprocessing_runner
        multiprocessing_runner = self
        results = None

        # Check if this is an action plugin. Some of them are designed
        # to be ran once per group of hosts. Example module: pause,
        # run once per hostgroup, rather than pausing once per each
        # host.
        p = utils.plugins.action_loader.get(self.module_name, self)
        if p and getattr(p, 'BYPASS_HOST_LOOP', None):
            # Expose the current hostgroup to the bypassing plugins
            self.host_set = hosts
            # We aren't iterating over all the hosts in this
            # group. So, just pick the first host in our group to
            # construct the conn object with.
            result_data = self._executor(hosts[0]).result
            # Create a ResultData item for each host in this group
            # using the returned result. If we didn't do this we would
            # get false reports of dark hosts.
            results = [ ReturnData(host=h, result=result_data, comm_ok=True) \
                           for h in hosts ]
            del self.host_set
        elif self.forks > 1:
            try:
                results = self._parallel_exec(hosts)
            except IOError, ie:
                print ie.errno
                if ie.errno == 32:
                    # broken pipe from Ctrl+C
                    raise errors.AnsibleError("interupted")
                raise
        else:
            results = [ self._executor(h) for h in hosts ]
        return self._partition_results(results)
1055850
def run_bang(alt_args=None):
    
    parser = get_parser()
    args = parser.parse_args(alt_args)

    source = args.config_specs or get_env_configs()
    if not source:
        return

    config = Config.from_config_specs(source)

    if args.playbooks:
        config[A.PLAYBOOKS] = args.playbooks

    if args.dump_config:

        if args.dump_config in ('yaml', 'yml'):
            import yaml
            print yaml.safe_dump(dict(config))
        elif args.dump_config == 'json':
            import json
            print json.dumps(config)
        else:
            print config
        sys.exit()

    set_ssh_creds(config, args)

    annoy(config)

    stack = Stack(config)

    if args.ansible_list:
        stack.show_inventory(
                os.isatty(sys.stdout.fileno())
                )
        return

    initialize_logging(config)
    # TODO:  config.validate()
    if args.deploy:
        stack.deploy()
    if args.configure:
        stack.configure()
    config.autoinc()
373822
def execute_ping(host_list, remote_user, remote_pass,
                 sudo=False, sudo_user=None, sudo_pass=None):
    '''
    
    '''
    runner = spam.ansirunner.AnsibleRunner()
    result, failed_hosts = runner.ansible_perform_operation(
        host_list=host_list,
        remote_user=remote_user,
        remote_pass=remote_pass,
        sudo=sudo,
        sudo_pass=sudo_pass,
        sudo_user=sudo_user,
        module="ping")

    print result, failed_hosts
    dark_hosts = runner.ansible_get_dark_hosts(result)
    print "dark hosts: ", dark_hosts
521298
def execute(self, ignore_cache=False, raise_on_error=True):
        
        if ignore_cache or not hasattr(self, '_response'):
            es = connections.get_connection(self._using)

            responses = es.msearch(
                index=self._index,
                body=self.to_dict(),
                **self._params
            )

            out = []
            for s, r in zip(self._searches, responses['responses']):
                if r.get('error', False):
                    if raise_on_error:
                        raise TransportError('N/A', r['error']['type'], r['error'])
                    r = None
                else:
                    r = Response(s, r)
                out.append(r)

            self._response = out

        return self._response
372511
def converge(ctx, scenario_name, ansible_args):  # pragma: no cover
    

    args = ctx.obj.get('args')
    subcommand = base._get_subcommand(__name__)
    command_args = {
        'subcommand': subcommand,
    }

    base.execute_cmdline_scenarios(scenario_name, args, command_args)