view modules/apache/manifests/mod/alias.pp @ 106:ef0926ee389a puppet-3.6

Lock down Apache headers for security, based on https://securityheaders.io/
author IBBoard <dev@ibboard.co.uk>
date Sat, 14 May 2016 17:10:10 +0100
parents 37675581a273
children 675c1cc61eaf
line wrap: on
line source

class apache::mod::alias(
  $apache_version = $apache::apache_version
) {
  $ver24 = versioncmp($apache_version, '2.4') >= 0

  $icons_path = $::osfamily ? {
    'debian'  => '/usr/share/apache2/icons',
    'redhat'  => $ver24 ? {
      true    => '/usr/share/httpd/icons',
      default => '/var/www/icons',
    },
    'freebsd' => '/usr/local/www/apache24/icons',
  }
  apache::mod { 'alias': }
  # Template uses $icons_path
  file { 'alias.conf':
    ensure  => file,
    path    => "${::apache::mod_dir}/alias.conf",
    content => template('apache/mod/alias.conf.erb'),
    require => Exec["mkdir ${::apache::mod_dir}"],
    before  => File[$::apache::mod_dir],
    notify  => Class['apache::service'],
  }
}