Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Bugfixes: Invalid references to 'name' on Ubuntu 12/Chef 10.4 correct…
…ed, and default action explicitly set to :enable to avoid the same problem.
  • Loading branch information
freerobby committed Jul 4, 2012
1 parent b11110b commit dd933ca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions definitions/monitrc.rb
@@ -1,18 +1,19 @@
# reload Reload monit so it notices the new service. :delayed (default) or :immediately.
# reload: Reload monit so it notices the new service. :delayed (default) or :immediately.
# action: :enable To create the monitoring config (default), or :disable to remove it.
define :monitrc, :action => :enable, :reload => :delayed do
if params[:enable]
template "/etc/monit/conf.d/#{name}.conf" do
if params[:action] == :enable
template "/etc/monit/conf.d/#{params[:name]}.conf" do
owner "root"
group "root"
mode 0644
source "#{name}.conf.erb"
source "#{params[:name]}.conf.erb"
cookbook "monit"
variables params
notifies :restart, resources(:service => "monit"), params[:reload]
action :create
end
else
template "/etc/monit/conf.d/#{name}.conf" do
template "/etc/monit/conf.d/#{params[:name]}.conf" do
action :delete
notifies :restart, resources(:service => "monit"), params[:reload]
end
Expand Down

0 comments on commit dd933ca

Please sign in to comment.