diff --git a/manifests/params.pp b/manifests/params.pp index 146b57e..df74e86 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -194,6 +194,9 @@ # "Send Notification" to be unchecked. # @param [boolean] ng_use_selinux_tools Whether to enable selinux tools and # policies. only effective if selinux is enabled. +# @param [array] ng_required_hosts Array of FQDNs for hosts which should be +# allowed/required. every entry in the array creates a new line in the +# configuration file. ############################################################################### class cd_nagios::params ( @@ -302,7 +305,7 @@ $ng_ack_no_send = '0', $ng_use_selinux_tools = true, # httpd - +$ng_required_hosts = [''], ) { diff --git a/templates/httpd/nagios_conf.erb b/templates/httpd/nagios_conf.erb index 73d5fb0..92bd19d 100644 --- a/templates/httpd/nagios_conf.erb +++ b/templates/httpd/nagios_conf.erb @@ -9,7 +9,7 @@ ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/" -<% if @ng_require_ssl == true -%> +<% if @ng_use_https == true -%> SSLRequireSSL <% else -%> # SSLRequireSSL @@ -19,8 +19,10 @@ ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/" = 2.3> Require all granted -# Require host 127.0.0.1 - + Require local +<% @ng_required_hosts.each do |required_host| -%> + Require host <%= required_host %> +<% end -%> AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd @@ -50,7 +52,10 @@ Alias /nagios "/usr/share/nagios/html" = 2.3> Require all granted -# Require host 127.0.0.1 + Require local +<% @ng_required_hosts.each do |required_host| -%> + Require host <%= required_host %> +<% end -%> AuthName "Nagios Access" AuthType Basic