Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Depend on the cutlery cookbook so we can use notifying_action utiliyt…

… method
  • Loading branch information...
commit c65194e75abd9bdbf2898bfd5223de1948c65cd4 1 parent 7eb6581
@realityforge authored
Showing with 9 additions and 3 deletions.
  1. +1 −0  metadata.rb
  2. +8 −3 providers/plugin.rb
View
1  metadata.rb
@@ -8,3 +8,4 @@
supports "ubuntu"
depends "build-essential"
+depends 'cutlery', '~> 0.1'
View
11 providers/plugin.rb
@@ -20,7 +20,12 @@ def template_map(type)
"#{plugin_prefix}plugin.conf.erb"
end
-action :create do
+notifying_action :create do
+ service 'collectd' do
+ supports :restart => true, :status => true
+ action :nothing
+ end
+
filename = "#{node['collectd']['conf_dir']}/#{new_resource.name}.conf"
if new_resource.content
file filename do
@@ -29,7 +34,7 @@ def template_map(type)
mode "644"
action :create
content new_resource.content
- notifies :restart, resources(:service => "collectd")
+ notifies :restart, 'service[collectd]', :delayed
end
else
type = new_resource.type || new_resource.name
@@ -41,7 +46,7 @@ def template_map(type)
source template
cookbook new_resource.cookbook
variables :type => type, :config => new_resource.config
- notifies :restart, resources(:service => "collectd")
+ notifies :restart, 'service[collectd]', :delayed
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.