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