Use default values and cleanup template
1 parent 88f12f9 commit e548f60cf9d4884c3f478eab47999d300bb245f0
@Andreas Jaggi Andreas Jaggi authored on 10 May 2013
Showing 2 changed files
View
2
■■■
manifests/init.pp
}
monit::sshdcheck { "sshdcheck_${fqdn}": }
}
 
define monit::options ($interval, $mailserver, $email, $http_address, $http_allow, $http_user, $http_password) {
define monit::options ($interval = 180, $mailserver = undef, $email = undef, $http_address = undef, $http_allow = undef, $http_user = undef, $http_password = undef) {
file { "/etc/monit/conf.d/options_$name":
mode => 600,
owner => root,
group => root,
View
24
templates/options.erb
# automatically generated by puppet for <%= fqdn %>, DO NOT MODIFY!
#
 
# check services interval
<% if has_variable?("interval") then %>
set daemon <%= interval %>
<% else %>
set daemon 180
<% if @interval then %>
set daemon <%= @interval %>
<% end %>
 
<% if has_variable?("mailserver") then %>
set mailserver <%= mailserver %>
<% if @mailserver then %>
set mailserver <%= @mailserver %>
<% end %>
 
<% if has_variable?("email") then %>
set alert <%= email %>
<% if @email then %>
set alert <%= @email %>
<% end %>
 
<% if has_variable?("http_address") and has_variable?("http_allow") and has_variable?("http_user") and has_variable?("http_password") then %>
<% if @http_address and @http_allow and @http_user and @http_password then %>
set httpd port 2812 and
use address <%= http_address %>
allow <%= http_allow %>
allow <%= http_user %>:<%= http_password %>
use address <%= @http_address %>
allow <%= @http_allow %>
allow <%= @http_user %>:<%= @http_password %>
<% end %>