Sha256: 52261cb599e3783a821c763de35b0d6cce2f2f3bb047dd427fec04d004c39f32

Contents?: true

Size: 890 Bytes

Versions: 6

Compression:

Stored size: 890 Bytes

Contents

require 'r10k/puppetfile'
require 'r10k/errors/formatting'
require 'r10k/action/visitor'
require 'r10k/action/base'

module R10K
  module Action
    module Puppetfile
      class Install < R10K::Action::Base

        def call
          @visit_ok = true
          pf = R10K::Puppetfile.new(@root, @moduledir, @puppetfile)
          pf.accept(self)
          @visit_ok
        end

        private

        include R10K::Action::Visitor

        def visit_puppetfile(pf)
          pf.load!
          yield
          pf.purge!
        end

        def visit_module(mod)
          logger.info _("Updating module %{mod_path}") % {mod_path: mod.path}
          mod.sync(force: false) # Don't force sync for 'puppetfile install' RK-265
        end

        def allowed_initialize_opts
          super.merge(root: :self, puppetfile: :self, moduledir: :self)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
r10k-2.5.2 lib/r10k/action/puppetfile/install.rb
r10k-2.5.1 lib/r10k/action/puppetfile/install.rb
r10k-2.4.5 lib/r10k/action/puppetfile/install.rb
r10k-2.4.4 lib/r10k/action/puppetfile/install.rb
r10k-2.5.0 lib/r10k/action/puppetfile/install.rb
r10k-2.4.3 lib/r10k/action/puppetfile/install.rb