cookbook new_resource.conf_cookbook
template new_resource.conf
variables new_resource.conf_variables
+ restart_munin false
end
end
end
if new_resource.conf # ~FC023
munin_plugin_conf new_resource.name do
action :delete
+ restart_munin false
end
end
end
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 initialize(*args)
- super
- notifies :restart, "service[munin-node]"
+def after_created
+ notifies :restart, "service[munin-node]" if restart_munin
end
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