1 class roles::snapshot_web {
3 include apache2::dynamic
4 include apache2::rewrite
12 apache2::site { '020-snapshot.debian.org':
13 site => 'snapshot.debian.org',
14 content => template('roles/snapshot/snapshot.debian.org.conf.erb')
19 $ipv4addr = '185.17.185.185'
20 $ipv6addr = '2001:1af8:4020:b030:deb::185'
21 $ipv6addr_apache = '2001:1af8:4020:b030:deb::187'
24 $ipv4addr = '193.62.202.27'
25 $ipv6addr = '2001:630:206:4000:1a1a:0:c13e:ca1b'
26 $ipv6addr_apache = '2001:630:206:4000:1a1a:0:c13e:ca1a'
29 fail ( "unknown host $::hostname for snapshot_web." )
35 @ferm::rule { 'dsa-snapshot-varnish-v4':
36 rule => '&SERVICE(tcp, 6081)',
38 @ferm::rule { 'dsa-nat-snapshot-varnish-v4':
40 chain => 'PREROUTING',
41 rule => "proto tcp daddr ${ipv4addr} dport 80 REDIRECT to-ports 6081",
44 varnish::config { 'default':
49 backend => 'file,/var/lib/varnish/varnish_storage.bin,8G',
50 content => template('roles/snapshot/snapshot.debian.org.vcl.erb'),
53 # the ipv6 port 80 is owned by varnish
54 file { '/etc/apache2/ports.conf':
57 Listen [$ipv6addr_apache]:80
59 require => Package['apache2'],
60 notify => Service['apache2'],
63 # haproxy ssl termination
64 #########################
66 file { '/etc/haproxy/haproxy.cfg':
67 content => template('roles/snapshot/haproxy.cfg.erb'),
68 require => Package['haproxy'],
69 notify => Service['haproxy'],
71 ssl::service { 'snapshot.debian.org':
72 notify => Service['haproxy'],