]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/resources/plugin.rb
Only try and restart munin-node if the munin recipe is applied
[chef.git] / cookbooks / munin / resources / plugin.rb
index 758d9b413da8762cceb945e2cc6793924d61aad0..5b93b8dea257a0fb662a67bd37a072abd77546b4 100644 (file)
@@ -25,3 +25,8 @@ attribute :target, :kind_of => String
 attribute :conf, :kind_of => String
 attribute :conf_cookbook, :kind_of => String
 attribute :conf_variables, :kind_of => Hash, :default => {}
+attribute :restart_munin, :kind_of => [TrueClass, FalseClass], :default => true
+
+def after_created
+  notifies :restart, "service[munin-node]" if restart_munin && node[:recipes].include?("munin")
+end