lib/bolt/module_installer.rb
# Installs a project's module dependencies.
#
Installs a project's module dependencies.
Installs a project ' s module dependencies .
def install(specs, path, moduledir, config = {}, force: false, resolve: true)
      @outputter.print_message("Installing project modules\n\n")
      if resolve != false
        specs = Specs.new(specs)
        if force || !path.exist?
          @outputter.print_action_step("Resolving module dependencies, this might take a moment")
          @outputter.start_spin
          puppetfile = Resolver.new.resolve(specs, config)
          @outputter.stop_spin
          @outputter.print_action_step("Writing Puppetfile at #{path}")
          if moduledir.basename.to_s == '.modules'
            puppetfile.write(path, moduledir)
          else
            puppetfile.write(path)
          end
        else
          puppetfile = Puppetfile.parse(path)
          puppetfile.assert_satisfies(specs)
        end
      end
      install_puppetfile(path, moduledir, config)
    end
def install ( specs , path , moduledir , config = { } , force : false , resolve : true ) @outputter . print_message ( "Installing project modules\n\n" ) if resolve != false specs = Specs . new ( specs ) if force || ! path . exist? @outputter . print_action_step ( "Resolving module dependencies, this might take a moment" ) @outputter . start_spin puppetfile = Resolver . new . resolve ( specs , config ) @outputter . stop_spin @outputter . print_action_step ( "Writing Puppetfile at #{path}" ) if moduledir . basename . to_s == '.modules' puppetfile . write ( path , moduledir ) else puppetfile . write ( path ) end else puppetfile = Puppetfile . parse ( path ) puppetfile . assert_satisfies ( specs ) end end install_puppetfile ( path , moduledir , config ) end
Installs a project's module dependencies.
Installs a project ' s module dependencies .
# If forcibly installing or if there is no Puppetfile, resolve # and write a Puppetfile. # This doesn't use the block as it's more testable to just mock *_spin # We get here either through 'bolt module install' which uses the # managed modulepath (which isn't configurable) or through bolt # project init --modules, which uses the default modulepath. This # should be safe to assume that if `.modules/` is the moduledir the # user is using the new workflow # If not forcibly installing and there is a Puppetfile, assert # that it satisfies the specs. # Install the modules.
specs
<not_specific>
path
<not_specific>
moduledir
<not_specific>
config
<not_specific>
force
<not_specific>
resolve
<not_specific>