]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
Add SSL related apache macros
[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         apache2::config { 'puppet-ssl-macros':
56                 source => 'puppet:///modules/apache2/puppet-ssl-macros',
57         }
58
59         file { '/etc/apache2/sites-available/common-ssl.inc':
60                 ensure => absent,
61         }
62
63         file { '/etc/logrotate.d/apache2':
64                 source => 'puppet:///modules/apache2/apache2.logrotate',
65         }
66
67         file { [ '/srv/www', '/srv/www/default.debian.org', '/srv/www/default.debian.org/htdocs' ]:
68                 ensure  => directory,
69                 mode    => '0755',
70         }
71
72         file { '/srv/www/default.debian.org/htdocs/index.html':
73                 content => template('apache2/default-index.html'),
74         }
75
76         munin::check { 'apache_accesses': }
77         munin::check { 'apache_processes': }
78         munin::check { 'apache_volume': }
79         munin::check { 'apache_servers': }
80         munin::check { 'ps_apache2':
81                 script => 'ps_',
82         }
83
84         if $::hostname in [beach,buxtehude,picconi,pkgmirror-1and1] {
85                 include apache2::dynamic
86         } else {
87                 @ferm::rule { 'dsa-http':
88                         prio        => '23',
89                         description => 'Allow web access',
90                         rule        => '&SERVICE(tcp, (http https))'
91                 }
92         }
93
94         @ferm::rule { 'dsa-http-v6':
95                 domain          => '(ip6)',
96                 prio            => '23',
97                 description     => 'Allow web access',
98                 rule            => '&SERVICE(tcp, (http https))'
99         }
100 }