]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/manifests/mod/disk_cache.pp
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / manifests / mod / disk_cache.pp
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',
7   }
8
9   $mod_name = $::osfamily ? {
10     'FreeBSD' => 'cache_disk',
11     default   => 'disk_cache',
12   }
13
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']
18   }
19   Class['::apache::mod::cache'] -> Class['::apache::mod::disk_cache']
20
21   apache::mod { $mod_name: }
22   # Template uses $cache_proxy
23   file { 'disk_cache.conf':
24     ensure  => file,
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'],
30   }
31 }