Module: Vagrant::Puppetfile::Evaluator
- Defined in:
- lib/vagrant/puppetfile.rb
Defined Under Namespace
Classes: Base, ConfigurationError, EvaluatorError, InstallationError, Librarian, Puppet, R10k
Constant Summary
collapse
- EVALUATORS =
%w(librarian-puppet r10k puppet)
Class Method Summary
collapse
Class Method Details
.autodetect(logger) ⇒ Object
144
145
146
147
148
149
150
151
152
|
# File 'lib/vagrant/puppetfile.rb', line 144
def Evaluator.autodetect(logger)
EVALUATORS.detect do |type|
begin
return create(type, logger)
rescue EvaluatorError => e
nil
end
end
end
|
.create(type, logger) ⇒ Object
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
# File 'lib/vagrant/puppetfile.rb', line 128
def Evaluator.create(type, logger)
case File.basename(type)
when 'librarian-puppet'
Librarian.new(type, logger)
when 'r10k'
R10k.new(type, logger)
when 'puppet'
Puppet.new(type, logger)
when 'autodetect'
autodetect(logger) or fail ConfigurationError
else
logger.warn("Invalid evaluator: #{type}")
fail ConfigurationError, type
end
end
|