]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
8d0ffdf3f0e18dd04b3757515920410c47ccb206
[dsa-puppet.git] / modules / apache2 / manifests / init.pp
1 # = Class: apache2
2 #
3 # Standard apache config debian.org hosts
4 #
5 # == Sample Usage:
6 #
7 #   include apache2
8 #
9 class apache2 {
10         package { 'apache2':
11                 ensure => installed,
12         }
13
14         service { 'apache2':
15                 ensure  => running,
16                 require => Package['apache2'],
17         }
18
19         apache2::module { 'info': }
20         apache2::module { 'status': }
21         apache2::module { 'headers': }
22
23         package { 'libapache2-mod-macro':
24                 ensure => installed
25         }
26
27         apache2::module { 'macro':
28                 require => Package['libapache2-mod-macro']
29         }
30
31         apache2::site { '00-default':
32                 site     => 'default-debian.org',
33                 content  => template('apache2/default-debian.org.erb'),
34         }
35
36         apache2::site { '000-default':
37                 ensure => absent,
38         }
39
40         apache2::config { 'ressource-limits':
41                 ensure => absent,
42         }
43
44         if has_role('buildd_master') {
45                 $memlimit = 192 * 1024 * 1024
46         } elsif has_role('buildd_ports_master') {
47                 $memlimit = 192 * 1024 * 1024
48         } elsif has_role('nagiosmaster') {
49                 $memlimit = 96 * 1024 * 1024
50         } elsif has_role('packagesqamaster') {
51                 $memlimit = 192 * 1024 * 1024
52         } elsif has_role('nm') {
53                 $memlimit = 96 * 1024 * 1024
54         } else {
55                 $memlimit = 32 * 1024 * 1024
56         }
57
58         apache2::config { 'resource-limits':
59                 content => template('apache2/resource-limits.erb'),
60         }
61
62         apache2::config { 'security':
63                 source => 'puppet:///modules/apache2/security',
64         }
65
66         apache2::config { 'logformat-privacy':
67                 source => 'puppet:///modules/apache2/logformat-privacy',
68         }
69
70         apache2::config { 'local-serverinfo':
71                 source => 'puppet:///modules/apache2/local-serverinfo',
72         }
73
74         apache2::config { 'server-status':
75                 source => 'puppet:///modules/apache2/server-status',
76         }
77
78         apache2::config { 'puppet-ssl-macros':
79                 source => 'puppet:///modules/apache2/puppet-ssl-macros',
80         }
81
82         apache2::config { 'puppet-config':
83                 source => 'puppet:///modules/apache2/puppet-config',
84         }
85
86         apache2::config { 'pratchett':
87                 source => 'puppet:///modules/apache2/pratchett',
88         }
89
90         file { '/etc/apache2/sites-available/common-ssl.inc':
91                 ensure => absent,
92         }
93
94         file { '/etc/logrotate.d/apache2':
95                 source => 'puppet:///modules/apache2/apache2.logrotate',
96         }
97
98         file { [ '/srv/www', '/srv/www/default.debian.org', '/srv/www/default.debian.org/htdocs' ]:
99                 ensure  => directory,
100                 mode    => '0755',
101         }
102
103         file { '/srv/www/default.debian.org/htdocs/index.html':
104                 content => template('apache2/default-index.html'),
105         }
106
107         file { '/var/log/apache2/.nobackup':
108                 mode    => '0644',
109                 content => '',
110         }
111
112         munin::check { 'apache_accesses': }
113         munin::check { 'apache_processes': }
114         munin::check { 'apache_volume': }
115         munin::check { 'apache_servers': }
116         munin::check { 'ps_apache2':
117                 script => 'ps_',
118         }
119
120         if $::hostname in [beach,buxtehude,picconi,pkgmirror-1and1] {
121                 include apache2::dynamic
122         } else {
123                 @ferm::rule { 'dsa-http':
124                         prio        => '23',
125                         description => 'Allow web access',
126                         rule        => '&SERVICE(tcp, (http https))'
127                 }
128         }
129
130         @ferm::rule { 'dsa-http-v6':
131                 domain          => '(ip6)',
132                 prio            => '23',
133                 description     => 'Allow web access',
134                 rule            => '&SERVICE(tcp, (http https))'
135         }
136 }