Skip to content

Commit

Permalink
feat(mod::remoteip): use Puppet 4+ data type
Browse files Browse the repository at this point in the history
  • Loading branch information
johanfleury committed Feb 2, 2019
1 parent 82611c7 commit 1503035
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions 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)
Expand Down

0 comments on commit 1503035

Please sign in to comment.