]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Install ipmitool on machines with the ipmi_si module loaded
[chef.git] / cookbooks / hardware / recipes / default.rb
index 837e1e9b06d9a8d5aad4ef0ad8c65b3d410b73af..b10eff2dbddbc9796451ff81bbd3def45846fd8e 100644 (file)
@@ -106,7 +106,7 @@ unless unit.nil?
     provider Chef::Provider::Service::Upstart
     action [ :enable, :start ]
     supports :status => true, :restart => true, :reload => false
-    subscribes :restart, resources(:template => "/etc/init/ttyS#{unit}.conf")
+    subscribes :restart, "template[/etc/init/ttyS#{unit}.conf]"
   end
 end
 
@@ -122,7 +122,7 @@ if File.exist?("/etc/default/grub")
     group "root"
     mode 0644
     variables :unit => unit, :speed => speed
-    notifies :run, resources(:execute => "update-grub")
+    notifies :run, "execute[update-grub]"
   end
 end
 
@@ -141,6 +141,10 @@ template "/etc/initramfs-tools/conf.d/mdadm" do
   notifies :run, "execute[update-initramfs]"
 end
 
+if node[:kernel][:modules].include?("ipmi_si")
+  package "ipmitool"
+end
+
 tools_packages = []
 status_packages = {}
 
@@ -154,7 +158,7 @@ node[:kernel][:modules].each_key do |modname|
     status_packages["cciss-vol-status"] ||= []
   when "mptsas"
     tools_packages << "lsiutil"
-    status_packages["mpt-status"] ||= []
+    #status_packages["mpt-status"] ||= []
   when "mpt2sas"
     tools_packages << "sas2ircu"
     status_packages["sas2ircu-status"] ||= []
@@ -172,8 +176,8 @@ end
 
 node[:block_device].each do |name,attributes|
   if attributes[:vendor] == "HP" and attributes[:model] == "LOGICAL VOLUME"
-    if name =~ /^cciss!(.*)$/
-      status_packages["cciss-vol-status"] |= [ "cciss/#{$1}" ]
+    if name =~ /^cciss!(c[0-9]+)d[0-9]+$/
+      status_packages["cciss-vol-status"] |= [ "cciss/#{$1}d0" ]
     else
       Dir.glob("/sys/block/#{name}/device/scsi_generic/*").each do |sg|
         status_packages["cciss-vol-status"] |= [ File.basename(sg) ]