view modules/apache/manifests/mod/alias.pp @ 76:a11219498f19 puppet-3.6

Do it properly and put a path in our cron job
author IBBoard <dev@ibboard.co.uk>
date Mon, 26 Oct 2015 08:46:22 +0000
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'],
  }
}