Sha256: 8379b29820d558b4388c84aab4bfd79b2edff27aea6076acf30070052139ecae

Contents?: true

Size: 714 Bytes

Versions: 9

Compression:

Stored size: 714 Bytes

Contents

class Chef
  class Recipe
    # name        The name of the service.  Looks for a template named NAME.conf
    # variables   Hash of variables to pass to the template
    # reload      Reload monit so it notices the new service.  :delayed (default) or :immediately.
    def monitrc(name, variables={}, reload = :delayed, &block)
      log "Making monitrc for: #{name}"
      template "/etc/monit/conf.d/#{name}.conf" do
        owner "root"
        group "root"
        mode 0644
        source "#{name}.monit.conf.erb"
        variables variables
        notifies :restart, resources(:service => "monit"), reload
        action :create
        
        instance_exec &block if block
      end
    end
  end
end  

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mana-0.0.10 cookbooks/monit/libraries/monitrc.rb
mana-0.0.8 cookbooks/monit/libraries/monitrc.rb
mana-0.0.7 cookbooks/monit/libraries/monitrc.rb
mana-0.0.6 cookbooks/monit/libraries/monitrc.rb
mana-0.0.5 cookbooks/monit/libraries/monitrc.rb
mana-0.0.4 cookbooks/monit/libraries/monitrc.rb
mana-0.0.3 cookbooks/monit/libraries/monitrc.rb
mana-0.0.2 cookbooks/monit/libraries/monitrc.rb
mana-0.0.1 cookbooks/monit/libraries/monitrc.rb