From: Tom Hughes Date: Wed, 6 Nov 2013 10:13:12 +0000 (+0000) Subject: Handle hpsa based RAID on newer HP machines X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/361ede788a09f6dd16b075d40f8b952493aafff8 Handle hpsa based RAID on newer HP machines --- diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index a60285253..c568cafd4 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -141,11 +141,13 @@ template "/etc/initramfs-tools/conf.d/mdadm" do notifies :run, "execute[update-initramfs]" end -["cciss", "mptsas", "mpt2sas", "megaraid_mm", "megaraid_sas", "aacraid"].each do |raidmod| +["cciss", "hpsa", "mptsas", "mpt2sas", "megaraid_mm", "megaraid_sas", "aacraid"].each do |raidmod| case raidmod when "cciss" tools_package = "hpacucli" status_package = "cciss-vol-status" + when "hpsa" + tools_package = "hpacucli" when "mptsas" tools_package = "lsiutil" status_package = "mpt-status" @@ -165,31 +167,36 @@ end if node[:kernel][:modules].include?(raidmod) package tools_package - package status_package - - template "/etc/default/#{status_package}d" do - source "raid.default.erb" - owner "root" - group "root" - mode 0644 - end - service "#{status_package}d" do - action [ :start, :enable ] - supports :status => false, :restart => true, :reload => false - subscribes :restart, "template[/etc/default/#{status_package}d]" + if status_package + package status_package + + template "/etc/default/#{status_package}d" do + source "raid.default.erb" + owner "root" + group "root" + mode 0644 + end + + service "#{status_package}d" do + action [ :start, :enable ] + supports :status => false, :restart => true, :reload => false + subscribes :restart, "template[/etc/default/#{status_package}d]" + end end else - package status_package do - action :purge + if status_package + package status_package do + action :purge + end + + file "/etc/default/#{status_package}d" do + action :delete + end end package tools_package do action :purge end - - file "/etc/default/#{status_package}d" do - action :delete - end end end