]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/resources/plugin_conf.rb
Clean up notification handling for the munin LWRPs
[chef.git] / cookbooks / munin / resources / plugin_conf.rb
index e4b99965db78ee7d8e7c8399e8b40dacee2b960b..e47b1336ba5ed4e075bbebc35ad8dc5d018fc491 100644 (file)
@@ -24,12 +24,8 @@ attribute :name, :kind_of => String, :name_attribute => true
 attribute :cookbook, :kind_of => String
 attribute :template, :kind_of => String, :required => true
 attribute :variables, :kind_of => Hash, :default => {}
 attribute :cookbook, :kind_of => String
 attribute :template, :kind_of => String, :required => true
 attribute :variables, :kind_of => Hash, :default => {}
+attribute :restart_munin, :kind_of => [TrueClass, FalseClass], :default => true
 
 
-def initialize(*args)
-  super
-  begin
-    resources(:service => "munin-node").subscrbes(:restart, self)
-  rescue Chef::Exceptions::ResourceNotFound
-    # Ignore
-  end
+def after_created
+  notifies :restart, "service[munin-node]" if restart_munin
 end
 end