def execute(self, exit=True): """ Execute the actions that should run prior to a converge and return a tuple. :param exit: (Unused) Provided to complete method signature. :return: Return a tuple provided by :meth:`.AnsiblePlaybook.execute`. """ debug = self.args.get('debug') if self.molecule.state.installed_deps: return (None, None) if self.molecule.dependencies == 'galaxy': dd = self.molecule.config.config.get('dependencies') if dd.get('requirements_file'): g = ansible_galaxy.AnsibleGalaxy(self.molecule.config.config, debug=debug) g.execute() self.molecule.state.change_state('installed_deps', True) elif self.molecule.dependencies == 'shell': dd = self.molecule.config.config.get('dependencies') if dd.get('command'): s = shell.Shell(self.molecule.config.config, debug=debug) s.execute() self.molecule.state.change_state('installed_deps', True) return (None, None)
def dependency(self): dependency_name = self.config['dependency']['name'] if dependency_name == 'galaxy': return ansible_galaxy.AnsibleGalaxy(self) elif dependency_name == 'gilt': return gilt.Gilt(self) elif dependency_name == 'shell': return shell.Shell(self)
def dependency(self): dependency_name = self.config['dependency']['name'] if dependency_name == 'galaxy': return ansible_galaxy.AnsibleGalaxy(self) elif dependency_name == 'gilt': return gilt.Gilt(self) else: util.exit_with_invalid_section('dependency', dependency_name)
def dependency(self): dependency_name = self.config["dependency"]["name"] if dependency_name == "galaxy": return ansible_galaxy.AnsibleGalaxy(self) elif dependency_name == "gilt": return gilt.Gilt(self) elif dependency_name == "shell": return shell.Shell(self)
def ansible_galaxy_instance(molecule_dependency_section_data, config_instance): config_instance.merge_dicts(config_instance.config, molecule_dependency_section_data) return ansible_galaxy.AnsibleGalaxy(config_instance)
def ansible_galaxy_instance(temp_files): confs = temp_files(fixtures=['molecule_vagrant_v1_config']) c = config.ConfigV1(configs=confs) c.config['dependency']['requirements_file'] = 'requirements.yml' return ansible_galaxy.AnsibleGalaxy(c.config)
def _instance(_dependency_section_data, patched_config_validate, config_instance): return ansible_galaxy.AnsibleGalaxy(config_instance)