lib/itamae/mitsurin/itamae_task.rb in itamae-mitsurin-0.2 vs lib/itamae/mitsurin/itamae_task.rb in itamae-mitsurin-0.3
- old
+ new
@@ -6,11 +6,10 @@
module Itamae
module Mitsurin
class ItamaeTask
class << self
-
class ::Hash
def deep_merge(other)
merger = lambda {|key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2}
self.merge(other, &merger)
end
@@ -72,12 +71,12 @@
namespace :itamae do
Dir.glob("nodes/**/*.json").each do |node_file|
bname = File.basename(node_file, '.json')
node_h = JSON.parse(File.read(node_file), symbolize_names: true)
- desc "Run to #{bname}"
+ desc "Itamae to #{bname}"
task node_h[:environments][:hostname].split(".")[0] do
begin
recipes = []
get_roles(node_file).each do |role|
recipes << get_recipes(role)
@@ -182,18 +181,16 @@
color.echos(:blue, %!Set Roles to \"#{get_roles(node_file).join(", ")}\"!)
run_list_noti = []
command_recipe.each {|c_recipe| run_list_noti << c_recipe.split("/") [2]}
color.echos(:green, %!Run List to \"#{run_list_noti.uniq.join(", ")}\"!)
puts color.echos(:white, %!#{command}!)
- stat = system command
- if ! stat then
- exit(false)
- end
+ st = system command
+ exit 1 unless st
end
end
end
-
end
+
end
end
end