lib/itamae-mitsurin/runner.rb in itamae-mitsurin-0.50 vs lib/itamae-mitsurin/runner.rb in itamae-mitsurin-1.0.0
- old
+ new
@@ -5,11 +5,10 @@
module ItamaeMitsurin
class Runner
class << self
def run(recipe_files, backend_type, options)
ItamaeMitsurin.logger.info "Starting Itamae..."
- ItamaeMitsurin.file_logger.info "Starting Itamae..."
backend = Backend.create(backend_type, options)
runner = self.new(backend, options)
runner.load_recipes(recipe_files)
runner.run
@@ -98,30 +97,30 @@
if @options[:ohai]
unless @backend.run_command("which ohai", error: false).exit_status == 0
# install Ohai
ItamaeMitsurin.logger.info "Installing Chef package... (to use Ohai)"
- ItamaeMitsurin.file_logger.info "Installing Chef package... (to use Ohai)"
@backend.run_command("curl -L https://www.opscode.com/chef/install.sh | bash")
end
ItamaeMitsurin.logger.info "Loading node data via ohai..."
- ItamaeMitsurin.file_logger.info "Loading node data via ohai..."
hash.merge!(JSON.parse(@backend.run_command("ohai").stdout))
end
if @options[:node_json]
path = File.expand_path(@options[:node_json])
ItamaeMitsurin.logger.info "Loading node data from #{path}..."
- ItamaeMitsurin.file_logger.info "Loading node data from #{path}..."
hash.merge!(JSON.load(open(path)))
end
if @options[:node_yaml]
path = File.expand_path(@options[:node_yaml])
ItamaeMitsurin.logger.info "Loading node data from #{path}..."
- ItamaeMitsurin.file_logger.info "Loading node data from #{path}..."
hash.merge!(YAML.load(open(path)) || {})
+ end
+
+ ItamaeMitsurin.logger.color(:green) do
+ ItamaeMitsurin.logger.info "Environment: #{hash['environments']['set']}"
end
Node.new(hash, @backend)
end