]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
do not do backups of /var/log/apache2/
[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         file { '/var/log/apache2/.nobackup':
78                 mode    => '0644',
79                 content => '',
80         }
81
82         munin::check { 'apache_accesses': }
83         munin::check { 'apache_processes': }
84         munin::check { 'apache_volume': }
85         munin::check { 'apache_servers': }
86         munin::check { 'ps_apache2':
87                 script => 'ps_',
88         }
89
90         if $::hostname in [beach,buxtehude,picconi,pkgmirror-1and1] {
91                 include apache2::dynamic
92         } else {
93                 @ferm::rule { 'dsa-http':
94                         prio        => '23',
95                         description => 'Allow web access',
96                         rule        => '&SERVICE(tcp, (http https))'
97                 }
98         }
99
100         @ferm::rule { 'dsa-http-v6':
101                 domain          => '(ip6)',
102                 prio            => '23',
103                 description     => 'Allow web access',
104                 rule            => '&SERVICE(tcp, (http https))'
105         }
106 }