found format options both for hosts and ips

This commit is contained in:
Arne Teuke
2017-07-21 13:51:07 +01:00
parent 442fd08f62
commit 5d12bf4437
2 changed files with 14 additions and 19 deletions

View File

@@ -194,12 +194,11 @@
# "Send Notification" to be unchecked. # "Send Notification" to be unchecked.
# @param [boolean] ng_use_selinux_tools Whether to enable selinux tools and # @param [boolean] ng_use_selinux_tools Whether to enable selinux tools and
# policies. only effective if selinux is enabled. # policies. only effective if selinux is enabled.
# @param [array] ng_required_hosts Array of **__FQDNs__** for hosts which # @param [string] ng_required_hosts String of **__FQDNs__** for hosts which
# should be allowed/required. every entry in the array creates a new line in # should be allowed/required. Requires format
# the configuration file. # 'host1.example.com host2.example.com'
# @param [array] ng_required_ips Array of **__Ip addresses __** for hosts which # @param [string] ng_required_ips string of **__Ip addresses __** for hosts which
# should be allowed/reqired. every entry in the array creates a new line in # should be allowed/reqired. Requires format 'ipaddress ip address range'
# the configuration file
############################################################################### ###############################################################################
class cd_nagios::params ( class cd_nagios::params (
@@ -309,7 +308,7 @@ $ng_use_selinux_tools = true,
# httpd # httpd
$ng_required_hosts = '', $ng_required_hosts = '',
$ng_required_ips = ['127.0.0.0/8'], $ng_required_ips = '127.0.0.0/8',
) { ) {

View File

@@ -20,13 +20,11 @@ ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/"
<RequireAll> <RequireAll>
Require all granted Require all granted
<% unless @ng_required_hosts.empty? -%> <% unless @ng_required_hosts.empty? -%>
<% @ng_required_hosts.each do |required_host| -%> Require host <%= @ng_required_hosts %>
Require host <%= required_host %> <% end -%>
<% end end -%> <% unless @ng_required_ips.empty? -%>
<% if @ng_required_ips != [] -%>
<% @ng_required_ips.each do |required_ips| -%>
Require ip <%= required_ips %> Require ip <%= required_ips %>
<% end end -%> <% end -%>
AuthName "Nagios Access" AuthName "Nagios Access"
AuthType Basic AuthType Basic
AuthUserFile /etc/nagios/passwd AuthUserFile /etc/nagios/passwd
@@ -57,13 +55,11 @@ Alias /nagios "/usr/share/nagios/html"
<RequireAll> <RequireAll>
Require all granted Require all granted
<% unless @ng_required_hosts.empty? -%> <% unless @ng_required_hosts.empty? -%>
<% @ng_required_hosts.each do |required_host| -%> Require host <%= @ng_required_hosts %>
Require host <%= required_host %> <% end -%>
<% end end -%> <% unless @ng_required_ips.empty? -%>
<% if @ng_required_ips != [] -%>
<% @ng_required_ips.each do |required_ips| -%>
Require ip <%= required_ips %> Require ip <%= required_ips %>
<% end end -%> <% end -%>
AuthName "Nagios Access" AuthName "Nagios Access"
AuthType Basic AuthType Basic
AuthUserFile /etc/nagios/passwd AuthUserFile /etc/nagios/passwd