]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Fix style issues found by new rubocop version
[chef.git] / cookbooks / hardware / recipes / default.rb
index d4c8d047037dc6650c7c52c1c7a90620cfd61dcb..d95825669fbf030c8d25ff35104a8fda11d020b1 100644 (file)
@@ -368,7 +368,7 @@ if tools_packages.include?("areca")
 end
 
 disks.each do |disk|
-  if disk[:device] =~ /^cciss\/(.*)$/
+  if disk[:device] =~ %r{^cciss/(.*)$}
     id = File.read("/sys/bus/cciss/devices/#{Regexp.last_match[1]}/unique_id").chomp
 
     disk[:munin] = "cciss-3#{id.downcase}"
@@ -405,6 +405,7 @@ if disks.count > 0
 
   service "smartmontools" do
     action [:enable, :start]
+    supports :status => true, :restart => true, :reload => true
   end
 
   disks.each do |disk|
@@ -430,7 +431,7 @@ else
 end
 
 plugins = Dir.glob("/etc/munin/plugins/smart_*").map { |p| File.basename(p) } -
-          disks.map { |d| "smart_#{d[:munin_name]}" }
+          disks.map { |d| "smart_#{d[:munin]}" }
 
 plugins.each do |plugin|
   munin_plugin plugin do