]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/resources/plugin_conf.rb
Make the rrddump.sh script do all the work, including cleanup.
[chef.git] / cookbooks / munin / resources / plugin_conf.rb
index e4b99965db78ee7d8e7c8399e8b40dacee2b960b..ce4c80739ad5779ec550baa78bfaa722391808b2 100644 (file)
@@ -21,15 +21,11 @@ actions :create, :delete
 default_action :create
 
 attribute :name, :kind_of => String, :name_attribute => true
-attribute :cookbook, :kind_of => String
+attribute :cookbook, :kind_of => [String, nil]
 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