]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
s/ressource/resource/
[dsa-puppet.git] / modules / apache2 / manifests / init.pp
1 class apache2 {
2
3         package { 'apache2':
4                 ensure => installed,
5         }
6
7         service { 'apache2':
8                 ensure  => running,
9                 require => Package['apache2'],
10         }
11
12         apache2::module { 'info': }
13         apache2::module { 'status': }
14
15         apache2::site { '00-default':
16                 site     => 'default-debian.org',
17                 content  => template('apache2/default-debian.org.erb'),
18         }
19
20         apache2::site { '000-default':
21                 ensure => absent,
22         }
23
24         apache2::config { 'ressource-limits':
25                 ensure => absent,
26         }
27
28         apache2::config { 'resource-limits':
29                 content => template('apache2/resource-limits.erb'),
30         }
31
32         apache2::config { 'security':
33                 source => 'puppet:///modules/apache2/security',
34         }
35
36         apache2::config { 'logformat-privacy':
37                 source => 'puppet:///modules/apache2/logformat-privacy',
38         }
39
40         apache2::config { 'local-serverinfo':
41                 source => 'puppet:///modules/apache2/local-serverinfo',
42         }
43
44         apache2::config { 'server-status':
45                 source => 'puppet:///modules/apache2/server-status',
46         }
47
48         file { '/etc/apache2/sites-available/common-ssl.inc':
49                 source => 'puppet:///modules/apache2/common-ssl.inc',
50                 require => Package['apache2'],
51                 notify  => Service['apache2'],
52         }
53
54         file { '/etc/logrotate.d/apache2':
55                 source => 'puppet:///modules/apache2/apache2.logrotate',
56         }
57
58         file { [ '/srv/www', '/srv/www/default.debian.org', '/srv/www/default.debian.org/htdocs' ]:
59                 ensure  => directory,
60                 mode    => '0755',
61         }
62
63         file { '/srv/www/default.debian.org/htdocs/index.html':
64                 content => template('apache2/default-index.html'),
65         }
66
67         munin::check { 'apache_accesses': }
68         munin::check { 'apache_processes': }
69         munin::check { 'apache_volume': }
70         munin::check { 'apache_servers': }
71         munin::check { 'ps_apache2':
72                 script => 'ps_',
73         }
74
75         if $::hostname in [beach,buxtehude,picconi,pkgmirror-1and1] {
76                 include apache2::dynamic
77         } else {
78                 @ferm::rule { 'dsa-http':
79                         prio        => '23',
80                         description => 'Allow web access',
81                         rule        => '&SERVICE(tcp, (http https))'
82                 }
83         }
84
85         @ferm::rule { 'dsa-http-v6':
86                 domain          => '(ip6)',
87                 prio            => '23',
88                 description     => 'Allow web access',
89                 rule            => '&SERVICE(tcp, (http https))'
90         }
91 }