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