aboutsummaryrefslogtreecommitdiffstats
path: root/modules/apache/manifests/base.pp
blob: a24040e39a3412e5428e48788486ccfe86925e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class apache::base {
    include apache::var

    # apache-mpm-prefork is merged from mga3 up
    $apache_server = $lsbdistrelease ? {
        /1|2/   => 'apache-mpm-prefork',
        default => 'apache',
    }

    package { $apache_server:
        alias => 'apache-server',
    }

    if versioncmp($::lsbdistrelease, '2') <= 0 {
        $conf_d = '/etc/httpd/conf.d'

        # only needed on mga1 and mga2
        package { $apache::var::pkg_conf: }
    } else {
        $conf_d = '/etc/httpd/conf/conf.d'
    }

    service { 'httpd':
        alias     => 'apache',
        subscribe => [ Package['apache-server'] ],
    }

    exec { 'apachectl configtest':
        refreshonly => true,
        notify      => Service['apache'],
    }

    apache::config {
        "${conf_d}/customization.conf":
            content => template('apache/customization.conf'),
            require => Package[$apache::var::pkg_conf];
        '/etc/httpd/conf/vhosts.d/00_default_vhosts.conf':
            content => template('apache/00_default_vhosts.conf'),
            require => Package[$apache::var::pkg_conf];
    }

    file { '/etc/logrotate.d/httpd':
        content => template('apache/logrotate')
    }
}