Fix duplicate resource warning
authorTom Hughes <tom@compton.nu>
Mon, 10 Feb 2014 21:09:18 +0000 (21:09 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 10 Feb 2014 21:09:18 +0000 (21:09 +0000)
cookbooks/munin/recipes/default.rb

index 6ad33e40afb431cc08a1011ebef948f47fe7923a..4bf1f8703602bcdad985ed266f321b306be8a79b 100644 (file)
@@ -253,8 +253,6 @@ sensors_temp = false
 sensors_volt = false
 
 Dir.glob("/sys/class/hwmon/hwmon*").each do |hwmon|
-  package "lm-sensors"
-
   hwmon = "#{hwmon}/device" unless File.exists?("#{hwmon}/name")
 
   sensors_fan = true unless Dir.glob("#{hwmon}/fan*_input").empty?
@@ -262,6 +260,10 @@ Dir.glob("/sys/class/hwmon/hwmon*").each do |hwmon|
   sensors_volt = true unless Dir.glob("#{hwmon}/in*_input").empty?
 end
 
+if sensors_fan || sensors_temp || sensors_volt
+  package "lm-sensors"
+end
+
 if sensors_fan
   munin_plugin "sensors_fan" do
     target "sensors_"