and use array for listening ports
[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  => [
20                                         ':6081',
21                                         '[2001:630:206:4000:1a1a:0:c13e:ca1b]:80'
22                                         ],
23                                 backend => 'file,/var/lib/varnish/varnish_storage.bin,8G',
24                                 content => template('roles/snapshot/snapshot.debian.org.vcl.erb'),
25                         }
26
27                         file { '/etc/apache2/ports.conf':
28                                 content  => @("EOF"),
29                                         Listen 0.0.0.0:80
30                                         Listen [2001:630:206:4000:1a1a:0:c13e:ca1a]:80
31                                         | EOF
32                                 require => Package['apache2'],
33                                 notify  => Service['apache2'],
34                         }
35                 }
36                 default: {
37                         fail ( "unknown host $::hostname for snapshot_web." )
38                 }
39         }
40 }