Class: R10K::Task::Puppetfile::Sync

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

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary

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) ⇒ Sync

Returns a new instance of Sync.



10
11
12
# File 'lib/r10k/task/puppetfile.rb', line 10

def initialize(puppetfile)
  @puppetfile = puppetfile
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/r10k/task/puppetfile.rb', line 14

def call
  logger.info "Loading modules from Puppetfile into queue"

  @puppetfile.load
  @puppetfile.modules.each do |mod|
    task = R10K::Task::Module::Sync.new(mod)
    task_runner.insert_task_after(self, task)
  end

  purge_task = Purge.new(@puppetfile)
  task_runner.append_task purge_task
end