5363acfee60e23ddbf3169378e69f36db73e340f
[mirror/dsa-puppet.git] / modules / roles / manifests / snapshot_web.pp
1 class roles::snapshot_web {
2         include apache2
3         include apache2::rewrite
4
5         ensure_packages ( [
6                 "libapache2-mod-wsgi",
7                 ], {
8                 ensure => 'installed',
9         })
10
11         apache2::site { '020-snapshot.debian.org':
12                 site   => 'snapshot.debian.org',
13                 content => template('roles/snapshot/snapshot.debian.org.conf.erb')
14         }
15
16         case $::hostname {
17                 'sallinen': {
18                         varnish::config { 'default':
19                                 listen  => ':6081,[2001:630:206:4000:1a1a:0:c13e:ca1b]:80',
20                                 backend => 'file,/var/lib/varnish/varnish_storage.bin,8G',
21                                 content => template('roles/snapshot/snapshot.debian.org.vcl.erb'),
22                         }
23
24                         file { '/etc/apache2/ports.conf':
25                                 content  => @("EOF"),
26                                         Listen 0.0.0.0:80
27                                         Listen [2001:630:206:4000:1a1a:0:c13e:ca1a]:80
28                                         | EOF
29                                 require => Package['apache2'],
30                                 notify  => Service['apache2'],
31                         }
32                 }
33                 default: {
34                         fail ( "unknown host $::hostname for snapshot_web." )
35                 }
36         }
37 }