Skip to content
This repository was archived by the owner on Jan 23, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ else
default["monit"]["includes_dir"] = "/etc/monit/conf.d"
end

# Custom include paths.
default["monit"]["includes"] = []

# The monit::default recipe will load these monit_monitrc resources automatically
# NOTE setting this attribute at the default level will append values to the array
default["monit"]["default_monitrc_configs"] = %w[load ssh]
Expand Down
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
default["monit"]["includes_dir"] = "/etc/monit/conf.d"
end

# Custom include paths.
default["monit"]["includes"] = []

# The monit::default recipe will load these monit_monitrc resources automatically
# NOTE setting this attribute at the default level will append values to the array
default["monit"]["default_monitrc_configs"] = %w[load ssh]
Expand Down
7 changes: 6 additions & 1 deletion templates/default/monitrc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@ set httpd port <%= node["monit"]["web_interface"]["port"] %>
<% end %>

# Include config files
include <%= node["monit"]["includes_dir"] %>/*
include "<%= node["monit"]["includes_dir"] %>/*"
<% if node["monit"]["includes"] && node["monit"]["includes"].size > 0 %>
<% node["monit"]["includes"].each do |path| %>
include "<%= path %>"
<% end %>
<% end %>