Class: R10K::Task::Puppetfile::DeployModules Deprecated

Inherits:
Base
  • Object
show all
Defined in:
lib/r10k/task/puppetfile.rb

Overview

Deprecated.

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary collapse

Attributes inherited from Base

#task_runner

Instance Method Summary collapse

Methods included from Logging

formatter, included, level, level=, levels, #logger, #logger_name, outputter, parse_level

Constructor Details

#initialize(puppetfile) ⇒ DeployModules

Returns a new instance of DeployModules.



34
35
36
# File 'lib/r10k/task/puppetfile.rb', line 34

def initialize(puppetfile)
  @puppetfile = puppetfile
end

Instance Attribute Details

#module_namesObject

Returns the value of attribute module_names.



32
33
34
# File 'lib/r10k/task/puppetfile.rb', line 32

def module_names
  @module_names
end

Instance Method Details

#callObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/r10k/task/puppetfile.rb', line 38

def call
  logger.debug "Updating module list for Puppetfile #{@puppetfile.basedir}"
  @puppetfile.load
  load_modulemap!

  existing = @modulemap.keys

  warn_on_missing(existing, @module_names)

  to_deploy = existing & @module_names

  to_deploy.each do |mod_name|
    mod = @modulemap[mod_name]
    task = R10K::Task::Module::Sync.new(mod)
    task_runner.insert_task_after(self, task)
  end
end