]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
enable mod headers everywhere
[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         apache2::config { 'resource-limits':
37                 content => template('apache2/resource-limits.erb'),
38         }
39
40         apache2::config { 'security':
41                 source => 'puppet:///modules/apache2/security',
42         }
43
44         apache2::config { 'logformat-privacy':
45                 source => 'puppet:///modules/apache2/logformat-privacy',
46         }
47
48         apache2::config { 'local-serverinfo':
49                 source => 'puppet:///modules/apache2/local-serverinfo',
50         }
51
52         apache2::config { 'server-status':
53                 source => 'puppet:///modules/apache2/server-status',
54         }
55
56         apache2::config { 'puppet-ssl-macros':
57                 source => 'puppet:///modules/apache2/puppet-ssl-macros',
58         }
59
60         file { '/etc/apache2/sites-available/common-ssl.inc':
61                 ensure => absent,
62         }
63
64         file { '/etc/logrotate.d/apache2':
65                 source => 'puppet:///modules/apache2/apache2.logrotate',
66         }
67
68         file { [ '/srv/www', '/srv/www/default.debian.org', '/srv/www/default.debian.org/htdocs' ]:
69                 ensure  => directory,
70                 mode    => '0755',
71         }
72
73         file { '/srv/www/default.debian.org/htdocs/index.html':
74                 content => template('apache2/default-index.html'),
75         }
76
77         munin::check { 'apache_accesses': }
78         munin::check { 'apache_processes': }
79         munin::check { 'apache_volume': }
80         munin::check { 'apache_servers': }
81         munin::check { 'ps_apache2':
82                 script => 'ps_',
83         }
84
85         if $::hostname in [beach,buxtehude,picconi,pkgmirror-1and1] {
86                 include apache2::dynamic
87         } else {
88                 @ferm::rule { 'dsa-http':
89                         prio        => '23',
90                         description => 'Allow web access',
91                         rule        => '&SERVICE(tcp, (http https))'
92                 }
93         }
94
95         @ferm::rule { 'dsa-http-v6':
96                 domain          => '(ip6)',
97                 prio            => '23',
98                 description     => 'Allow web access',
99                 rule            => '&SERVICE(tcp, (http https))'
100         }
101 }