X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Fmanifests%2Fsnapshot_web.pp;h=ee9ab949f033ac67db73e0f99a4650604cdf83ab;hb=d63068dc7d8ace2d3fc0b6076b97b798b24e2b08;hp=c3eeddd2b630d92b1951813b9fa4f02d888ff6fb;hpb=6a2039dedd027ef48dccb4022ffaef1747ae2cec;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/manifests/snapshot_web.pp b/modules/roles/manifests/snapshot_web.pp index c3eeddd2b..ee9ab949f 100644 --- a/modules/roles/manifests/snapshot_web.pp +++ b/modules/roles/manifests/snapshot_web.pp @@ -12,4 +12,63 @@ class roles::snapshot_web { site => 'snapshot.debian.org', content => template('roles/snapshot/snapshot.debian.org.conf.erb') } + + case $::hostname { + 'lw07': { + $ipv4addr = '185.17.185.185' + $ipv6addr = '2001:1af8:4020:b030:deb::185' + $ipv6addr_apache = '2001:1af8:4020:b030:deb::187' + } + 'sallinen': { + $ipv4addr = '193.62.202.27' + $ipv6addr = '2001:630:206:4000:1a1a:0:c13e:ca1b' + $ipv6addr_apache = '2001:630:206:4000:1a1a:0:c13e:ca1a' + } + default: { + fail ( "unknown host $::hostname for snapshot_web." ) + } + } + + # varnish cache + ############### + @ferm::rule { 'dsa-snapshot-varnish-v4': + rule => '&SERVICE(tcp, 6081)', + } + @ferm::rule { 'dsa-nat-snapshot-varnish-v4': + table => 'nat', + chain => 'PREROUTING', + rule => "proto tcp daddr ${ipv4addr} dport 80 REDIRECT to-ports 6081", + } + + varnish::config { 'default': + listen => [ + ':6081', + "[$ipv6addr]:80" + ], + backend => 'file,/var/lib/varnish/varnish_storage.bin,8G', + content => template('roles/snapshot/snapshot.debian.org.vcl.erb'), + } + + # the ipv6 port 80 is owned by varnish + file { '/etc/apache2/ports.conf': + content => @("EOF"), + Listen 0.0.0.0:80 + Listen [$ipv6addr_apache]:80 + | EOF + require => Package['apache2'], + notify => Service['apache2'], + } + + # haproxy ssl termination + ######################### + include haproxy + file { '/etc/haproxy/haproxy.cfg': + content => template('roles/snapshot/haproxy.cfg.erb'), + require => Package['haproxy'], + notify => Service['haproxy'], + } + ssl::service { 'snapshot.debian.org': + notify => Service['haproxy'], + key => true, + } }