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