diff --git a/templates/mod/_require.epp b/templates/mod/_require.epp index 577e679a0..4e12043b8 100644 --- a/templates/mod/_require.epp +++ b/templates/mod/_require.epp @@ -1,12 +1,12 @@ -<% if type($requires, 'generalized') == String { -%> +<% if $requires =~ String { -%> <%- if !($requires.downcase in ['', 'unmanaged']) { -%> Require <%= $requires %> <%- } -%> -<% }elsif String(type($requires, 'generalized')).index('Array') == 0 { -%> +<% } elsif $requires =~ Array { -%> <%- $requires.each |$req| { -%> Require <%= $req %> <%- } -%> -<% }elsif String(type($requires, 'generalized')).index('Hash') == 0 { -%> +<% } elsif $requires =~ Hash { -%> <%- if $requires['enforce'] and $requires['enforce'].downcase in ['all', 'none', 'any'] { -%> <%- $enforce_str = "Require${requires['enforce'].capitalize}>\n" -%> <%- $enforce_open = " <${enforce_str}" -%> @@ -20,7 +20,7 @@ <%- $enforce_close = '' -%> <%- $indentation = '' -%> <%- } -%> - <%- if $requires['requires'] and String(type($requires['requires'], 'generalized')).index('Array') == 0 { -%> + <%- if $requires['requires'] and $requires['requires'] =~ Array { -%> <%# %><%= $enforce_open -%> <%- $requires['requires'].each |$req| { -%> <%# %> <%= $indentation -%>Require <%= $req %> diff --git a/templates/mod/geoip.conf.epp b/templates/mod/geoip.conf.epp index 309e2170f..c1efd706a 100644 --- a/templates/mod/geoip.conf.epp +++ b/templates/mod/geoip.conf.epp @@ -1,12 +1,8 @@ GeoIPEnable <%= apache::bool2httpd($enable) %> <%- if $db_file and !($db_file in [ false, 'false', '' ]) { -%> - <%- if String(type($db_file, 'generalized')).index('Array') == 0 { -%> - <%- Array($db_file).each |$file| { -%> + <%- [$db_file].flatten.each |$file| { -%> GeoIPDBFile <%= $file %> <%= $flag %> - <%- } -%> - <%- } else { -%> -GeoIPDBFile <%= $db_file %> <%= $flag %> <%- } -%> <%- } -%> GeoIPOutput <%= $output %> diff --git a/templates/mod/negotiation.conf.epp b/templates/mod/negotiation.conf.epp index 5183e2b8f..df7cabd9b 100644 --- a/templates/mod/negotiation.conf.epp +++ b/templates/mod/negotiation.conf.epp @@ -1,12 +1,2 @@ -<% if String(type($language_priority, 'generalized')).index('Array') == 0 { -%> - <%- $language_priority_updated = $language_priority.join(' ') -%> -<% } else { -%> - <%- $language_priority_updated = $language_priority -%> -<% } -%> -<% if String(type($force_language_priority, 'generalized')).index('Array') == 0 { -%> - <%- $force_language_priority_updated = $force_language_priority.join(' ') -%> -<% } else { -%> - <%- $force_language_priority_updated = $force_language_priority -%> -<% } -%> -LanguagePriority <%= $language_priority_updated %> -ForceLanguagePriority <%= $force_language_priority_updated %> +LanguagePriority <%= [$language_priority].flatten.join(' ') %> +ForceLanguagePriority <%= [$force_language_priority].flatten.join(' ') %> diff --git a/templates/mod/pagespeed.conf.epp b/templates/mod/pagespeed.conf.epp index 840a8eeaa..081758a52 100644 --- a/templates/mod/pagespeed.conf.epp +++ b/templates/mod/pagespeed.conf.epp @@ -78,7 +78,7 @@ ModPagespeedMessageBufferSize <%= $message_buffer_size %> SetHandler mod_pagespeed_message -<% if String(type($additional_configuration, 'generalized')).index('Array') == 0 { -%> +<% if $additional_configuration =~ Array { -%> <%= $additional_configuration.join("\n") %> <% } else { -%> <% $additional_configuration.each |$key, $value| { -%> diff --git a/templates/mod/proxy.conf.epp b/templates/mod/proxy.conf.epp index b9aca2e96..3fad4efa2 100644 --- a/templates/mod/proxy.conf.epp +++ b/templates/mod/proxy.conf.epp @@ -10,11 +10,7 @@ <% if $proxy_requests != 'Off' or ( $allow_from and ! $allow_from.empty ) { -%> - <%- if String(type($allow_from, 'generalized')).index('Array') == 0 { -%> - Require ip <%= $allow_from.join(" ") %> - <%- } else { -%> - Require ip <%= $allow_from %> - <%- } -%> + Require ip <%= [$allow_from].flatten.join(' ') %> <% } -%> diff --git a/templates/mod/reqtimeout.conf.epp b/templates/mod/reqtimeout.conf.epp index a62b4b69a..633e9db0f 100644 --- a/templates/mod/reqtimeout.conf.epp +++ b/templates/mod/reqtimeout.conf.epp @@ -1,8 +1,4 @@ -<% if type($timeouts, 'generalized') == String { -%> -RequestReadTimeout <%= $timeouts -%> -<% } else { -%> - <%- $timeouts.each |$timeout| { -%> +<%- [$timeouts].flatten.each |$timeout| { -%> RequestReadTimeout <%= $timeout %> - <%- } -%> <% } -%> diff --git a/templates/mod/ssl.conf.epp b/templates/mod/ssl.conf.epp index 39c2f8270..2aa1b885c 100644 --- a/templates/mod/ssl.conf.epp +++ b/templates/mod/ssl.conf.epp @@ -33,7 +33,7 @@ SSLStaplingReturnResponderErrors <%= apache::bool2httpd($ssl_stapling_return_errors) %> <%- } -%> SSLStaplingCache "shmcb:<%= $_stapling_cache %>" - <%- if String(type($ssl_cipher, 'generalized')).index('Hash') == 0 { -%> + <%- if $ssl_cipher =~ Hash { -%> <%- $ssl_cipher.map |$protocol, $cipher| { -%> SSLCipherSuite <%= $protocol %> <%= $cipher %> <%- } -%>