]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/providers/plugin.rb
Use inline compile mode for munin LWRPs
[chef.git] / cookbooks / munin / providers / plugin.rb
index 2937190665a63025bbebe5ce350e34df90f6048d..e469acb6d1610a70e4d8c7d3a74f9189c666b1fa 100644 (file)
@@ -21,50 +21,38 @@ def whyrun_supported?
   true
 end
 
   true
 end
 
+use_inline_resources
+
 action :create do
   link_action = case target_path
                 when nil then :delete
                 else :create
                 end
 
 action :create do
   link_action = case target_path
                 when nil then :delete
                 else :create
                 end
 
-  l = link plugin_path do
+  link plugin_path do
     action link_action
     to target_path
     action link_action
     to target_path
-    notifies :restart, "service[munin-node]"
   end
 
   end
 
-  updated = l.updated_by_last_action?
-
-  if new_resource.conf
-    c = munin_plugin_conf new_resource.name do
+  if new_resource.conf # ~FC023
+    munin_plugin_conf new_resource.name do
       cookbook new_resource.conf_cookbook
       template new_resource.conf
       variables new_resource.conf_variables
     end
       cookbook new_resource.conf_cookbook
       template new_resource.conf
       variables new_resource.conf_variables
     end
-
-    updated ||= c.updated_by_last_action?
   end
   end
-
-  new_resource.updated_by_last_action(updated)
 end
 
 action :delete do
 end
 
 action :delete do
-  l = link plugin_path do
+  link plugin_path do
     action :delete
     action :delete
-    notifies :restart, "service[munin-node]"
   end
 
   end
 
-  updated = l.updated_by_last_action?
-
-  if new_resource.conf
-    c = munin_plugin_conf new_resource.name do
+  if new_resource.conf # ~FC023
+    munin_plugin_conf new_resource.name do
       action :delete
     end
       action :delete
     end
-
-    updated ||= c.updated_by_last_action?
   end
   end
-
-  new_resource.updated_by_last_action(updated)
 end
 
 def plugin_path
 end
 
 def plugin_path