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