Permalink
Browse files

attributes can only be one of String, Array or Hash

  • Loading branch information...
1 parent 17acfd6 commit 077716327a8d1dbed52f876d9c00923589515c15 @phlipper committed Aug 27, 2011
Showing with 20 additions and 20 deletions.
  1. +10 −10 attributes/default.rb
  2. +5 −5 metadata.rb
  3. +5 −5 templates/default/monitrc.erb
View
@@ -17,24 +17,24 @@
# limitations under the License.
#
-default["monit"]["polling_frequency"] = 20
-default["monit"]["use_syslog"] = true
+default["monit"]["polling_frequency"] = "20"
+default["monit"]["use_syslog"] = "true"
default["monit"]["logfile"] = "/var/log/monit.log"
default["monit"]["alert_email"] = "root@localhost"
default["monit"]["web_interface"] = {
- :enable => false,
- :port => 2812,
+ :enable => "false",
+ :port => "2812",
:address => "localhost",
:allow => ["localhost", "admin:b1gbr0th3r"]
}
default["monit"]["mail"] = {
:hostname => "localhost",
- :port => 25
- :username => nil,
- :password => nil,
+ :port => "25"
+ :username => "",
+ :password => "",
:from => "monit@localhost",
- :tls => false,
- :timeout => 30
-}
+ :tls => "",
+ :timeout => ""
+}
View
@@ -15,7 +15,7 @@
attribute "monit/use_syslog",
:display_name => "Use Syslog",
:description => "Use syslog for logging instead of a logfile",
- :default => true
+ :default => "true"
attribute "monit/logfile",
:display_name => "Log File",
@@ -26,7 +26,7 @@
:display_name => "Web Interface Settings",
:description => "Enable the web interface and define credentials",
:default => {
- :enable => false, :port => "2812", :address => "localhost",
+ :enable => "false", :port => "2812", :address => "localhost",
:allow => ["localhost", "admin:b1gbr0th3r"]
}
@@ -41,9 +41,9 @@
:default => {
:hostname => "localhost",
:port => "25",
- :username => nil,
- :password => nil,
+ :username => "",
+ :password => "",
:from => "monit@localhost",
- :tls => false,
+ :tls => "false",
:timeout => "30"
}
@@ -2,29 +2,29 @@
set daemon <%= node[:monit][:polling_frequency] %>
# Logging
-<% if node[:monit][:syslog] %>
+<% if node[:monit][:syslog] == "true" %>
set logfile syslog facility log_daemon
<% else %>
set logfile <%= node[:monit][:logfile] %>
<% end %>
# Mail alerts
set mailserver <%= node[:monit][:mail][:hostname] %> port <%= node[:monit][:mail][:port] %>
- <% if node[:monit][:mail][:username] -%>
+ <% if !node[:monit][:mail][:username].empty? -%>
username "<%= node[:monit][:mail][:username] %>"
<% end -%>
- <% if node[:monit][:mail][:password] -%>
+ <% if !node[:monit][:mail][:password].empty? -%>
password "<%= node[:monit][:mail][:password] %>"
<% end -%>
- <% if node[:monit][:mail][:tls] -%>
+ <% if node[:monit][:mail][:tls] == "true" -%>
using tlsv1
<% end -%>
with timeout <%= node[:monit][:mail][:timeout] %> seconds
set mail-format { from: <%= node[:monit][:mail][:from] %> }
set alert <%= node[:monit][:alert_email] %>
# Web interface
-<% if node[:monit][:web_interface][:enable] %>
+<% if node[:monit][:web_interface][:enable] == "true" %>
set httpd port <%= node[:monit][:web_interface][:port] %> and
use address <%= node[:monit][:web_interface][:address] %>
<% node[:monit][:web_interface][:allow].each do |allow| -%>

0 comments on commit 0777163

Please sign in to comment.