Example #1
0
    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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
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)
Example #6
0
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)
Example #7
0
def _instance(_dependency_section_data, patched_config_validate, config_instance):
    return ansible_galaxy.AnsibleGalaxy(config_instance)