]> git.openstreetmap.org Git - chef.git/commitdiff
Disable hddtemp_smartctl if we have rejected all disks
authorTom Hughes <tom@compton.nu>
Wed, 7 Oct 2015 08:24:06 +0000 (09:24 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 7 Oct 2015 08:29:01 +0000 (09:29 +0100)
cookbooks/hardware/recipes/default.rb

index bb7de4a98d1418510e7d67ef9ba1a38cc40cc75a..b4986e70e34a6eba5b2b034e3c471ce0b526d275 100644 (file)
@@ -452,18 +452,21 @@ if disks.count > 0
       conf_variables :disk => disk
     end
   end
+else
+  service "smartmontools" do
+    action [:stop, :disable]
+  end
+end
 
+if disks.count > 0
   munin_plugin "hddtemp_smartctl" do
     conf "munin.hddtemp.erb"
     conf_variables :disks => disks
   end
 else
-  service "smartmontools" do
-    action [:stop, :disable]
-  end
-
   munin_plugin "hddtemp_smartctl" do
     action :delete
+    conf "munin.hddtemp.erb"
   end
 end