Sha256: 1c1faeda3f7f97d27fd5812a48038acefd1e8bfc0b493054c59a77ddd9f210e4

Contents?: true

Size: 1.14 KB

Versions: 33

Compression:

Stored size: 1.14 KB

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, nil , @force)
          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)
          @force ||= false
          logger.info _("Updating module %{mod_path}") % {mod_path: mod.path}

          if mod.respond_to?(:desired_ref) && mod.desired_ref == :control_branch
            logger.warn _("Cannot track control repo branch for content '%{name}' when not part of a 'deploy' action, will use default if available." % {name: mod.name})
          end

          mod.sync(force: @force)
        end

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

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
r10k-3.9.0 lib/r10k/action/puppetfile/install.rb
r10k-3.8.0 lib/r10k/action/puppetfile/install.rb
r10k-3.7.0 lib/r10k/action/puppetfile/install.rb
r10k-3.6.0 lib/r10k/action/puppetfile/install.rb
r10k-2.6.9 lib/r10k/action/puppetfile/install.rb
r10k-3.5.2 lib/r10k/action/puppetfile/install.rb
r10k-3.5.1 lib/r10k/action/puppetfile/install.rb
r10k-3.5.0 lib/r10k/action/puppetfile/install.rb
r10k-3.4.1 lib/r10k/action/puppetfile/install.rb
r10k-2.6.8 lib/r10k/action/puppetfile/install.rb
r10k-3.4.0 lib/r10k/action/puppetfile/install.rb
r10k-3.3.3 lib/r10k/action/puppetfile/install.rb
r10k-3.2.3 lib/r10k/action/puppetfile/install.rb
r10k-2.6.7 lib/r10k/action/puppetfile/install.rb
r10k-3.3.2 lib/r10k/action/puppetfile/install.rb
r10k-3.3.1 lib/r10k/action/puppetfile/install.rb
r10k-3.2.1 lib/r10k/action/puppetfile/install.rb
r10k-3.0.4 lib/r10k/action/puppetfile/install.rb
r10k-2.6.6 lib/r10k/action/puppetfile/install.rb
r10k-3.3.0 lib/r10k/action/puppetfile/install.rb