1 class apache::mod::disk_cache {
2 $cache_root = $::osfamily ? {
3 'debian' => '/var/cache/apache2/mod_disk_cache',
4 'redhat' => '/var/cache/mod_proxy',
5 'freebsd' => '/var/cache/mod_disk_cache',
6 'gentoo' => '/var/cache/apache2/mod_disk_cache',
9 $mod_name = $::osfamily ? {
10 'FreeBSD' => 'cache_disk',
11 default => 'disk_cache',
14 if $::osfamily != 'FreeBSD' {
15 # FIXME: investigate why disk_cache was dependent on proxy
16 # NOTE: on FreeBSD disk_cache is compiled by default but proxy is not
17 Class['::apache::mod::proxy'] -> Class['::apache::mod::disk_cache']
19 Class['::apache::mod::cache'] -> Class['::apache::mod::disk_cache']
21 apache::mod { $mod_name: }
22 # Template uses $cache_proxy
23 file { 'disk_cache.conf':
25 path => "${::apache::mod_dir}/disk_cache.conf",
26 content => template('apache/mod/disk_cache.conf.erb'),
27 require => Exec["mkdir ${::apache::mod_dir}"],
28 before => File[$::apache::mod_dir],
29 notify => Class['apache::service'],