]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/manifests/mod/remoteip.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / apache / manifests / mod / remoteip.pp
1 class apache::mod::remoteip (
2   $header            = 'X-Forwarded-For',
3   $proxy_ips         = [ '127.0.0.1' ],
4   $proxies_header    = undef,
5   $trusted_proxy_ips = undef,
6   $apache_version    = $::apache::apache_version
7 ) {
8   if versioncmp($apache_version, '2.4') < 0 {
9     fail('mod_remoteip is only available in Apache 2.4')
10   }
11
12   ::apache::mod { 'remoteip': }
13
14   # Template uses:
15   # - $header
16   # - $proxy_ips
17   # - $proxies_header
18   # - $trusted_proxy_ips
19   file { 'remoteip.conf':
20     ensure  => file,
21     path    => "${::apache::mod_dir}/remoteip.conf",
22     content => template('apache/mod/remoteip.conf.erb'),
23     require => Exec["mkdir ${::apache::mod_dir}"],
24     before  => File[$::apache::mod_dir],
25     notify  => Service['httpd'],
26   }
27 }