From 1503035d788f9fdaa2bab9cdaabfb66e858c2c39 Mon Sep 17 00:00:00 2001 From: Johan Fleury Date: Sat, 2 Feb 2019 15:48:30 -0500 Subject: [PATCH] feat(mod::remoteip): use Puppet 4+ data type --- manifests/mod/remoteip.pp | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/manifests/mod/remoteip.pp b/manifests/mod/remoteip.pp index 21ad57f3e0..51627210ac 100644 --- a/manifests/mod/remoteip.pp +++ b/manifests/mod/remoteip.pp @@ -1,9 +1,37 @@ +# @summary Setup and load Apache `mod_remoteip` +# +# @see https://httpd.apache.org/docs/current/mod/mod_remoteip.html +# +# @param header +# The header field in which `mod_remoteip` will look for the useragent IP. +# +# @param proxy_ips +# A list of IP addresses, IP blocks or hostname that are trusted to set a +# valid value inside specified header. Unlike the `$trusted_proxy_ips` +# parameter, any IP address (including private addresses) presented by these +# proxies will trusted by `mod_remoteip`. +# +# @param proxies_header +# A header into which `mod_remoteip` will collect a list of all of the +# intermediate client IP addresses trusted to resolve the useragent IP of the +# request (e.g. `X-Forwarded-By`). +# +# @param trusted_proxy_ips +# A list of IP addresses, IP blocks or hostname that are trusted to set a +# valid value inside the specified header. Unlike the `$proxy_ips` parameter, +# any private IP presented by these proxies will be disgarded by +# `mod_remoteip`. +# +# @param apache_version +# A version string used to validate that your apache version supports +# `mod_remoteip`. If not specified, `$::apache::apache_version` is used. +# class apache::mod::remoteip ( - $header = 'X-Forwarded-For', - $proxy_ips = [ '127.0.0.1' ], - $proxies_header = undef, - $trusted_proxy_ips = undef, - $apache_version = undef, + String $header = 'X-Forwarded-For', + Optional[Array[Stdlib::Host]] $proxy_ips = [ '127.0.0.1' ], + Optional[String] $proxies_header = undef, + Optional[Array[Stdlib::Host]] $trusted_proxy_ips = undef, + Optional[String] $apache_version = undef, ) { include ::apache $_apache_version = pick($apache_version, $apache::apache_version)