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

Commit

Permalink
Add the ability to include multiple user defined directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo Rhett committed Nov 4, 2015
1 parent a438e86 commit 086e751
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
default['icinga2']['objects_dir'] = ::File.join(node['icinga2']['conf_dir'], node['icinga2']['objects_d'])

# user defined icing2 object / configuration
default['icinga2']['user_defined_objects_d'] = 'user_defined_objects'
default['icinga2']['user_defined_objects_d'] = 'user_defined_objects' # use an array for multiple directories
default['icinga2']['user_defined_objects_dir'] = ::File.join(node['icinga2']['conf_dir'], node['icinga2']['user_defined_objects_d'])

default['icinga2']['features_enabled_dir'] = ::File.join(node['icinga2']['conf_dir'], 'features-enabled')
Expand Down
8 changes: 7 additions & 1 deletion templates/default/icinga2.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@ include_recursive "<%= node['icinga2']['objects_d'] -%>"

<% if node['icinga2']['user_defined_objects_d'] -%>
// User defined Objects / Configuration
<% if node['icinga2']['user_defined_objects_d'].is_a? Array
node['icinga2']['user_defined_objects_d'].each do |include_dir| -%>
include_recursive "<%= include_dir -%>"
<% end # each -%>
<% else # if not array -%>
include_recursive "<%= node['icinga2']['user_defined_objects_d'] -%>"
<% end -%>
<% end # if array -%>
<% end # if objects_d defined -%>

0 comments on commit 086e751

Please sign in to comment.