Add vhost_listen_443
authorPeter Palfrader <peter@palfrader.org>
Wed, 1 Jan 2014 16:20:25 +0000 (17:20 +0100)
committerPeter Palfrader <peter@palfrader.org>
Wed, 1 Jan 2014 16:20:25 +0000 (17:20 +0100)
modules/roles/manifests/static_mirror.pp
modules/roles/manifests/www_mirror.pp
modules/roles/templates/static-mirroring/static-vhost.conf.erb

index 5962bf5..f37b810 100644 (file)
@@ -31,6 +31,10 @@ class roles::static_mirror {
                klecker => '130.89.148.14:80 [2001:610:1908:b000::148:14]:80',
                default => '*:80',
        }
+       $vhost_listen_443 = $::hostname ? {
+               klecker => '130.89.148.14:443 [2001:610:1908:b000::148:14]:443',
+               default => '*:443',
+       }
 
        apache2::config { 'local-static-vhost.conf':
                content => template('roles/static-mirroring/static-vhost.conf.erb'),
index a6c344d..9cb9cf0 100644 (file)
@@ -3,6 +3,7 @@ class roles::www_mirror {
 
        $wwwdo_document_root = '/srv/www.debian.org/www'
        $vhost_listen = '*:80'
+       $vhost_listen_443 = '*:443'
        apache2::site { '010-www.debian.org':
                site   => 'www.debian.org',
                content => template('roles/apache-www.debian.org.erb'),
index d9b6367..9b76aef 100644 (file)
 
 
 <Macro common-static-vhost-ssl $name>
-       Use common-debian-service-https-redirect <%= vhost_listen %> $name
+       <VirtualHost <%= vhost_listen %> >
+               ServerName $name
+               ServerAdmin debian-admin@lists.debian.org
+
+               CustomLog /var/log/apache2/$name-access.log privacy
+               ErrorLog /var/log/apache2/$name-error.log
+
+               Redirect permanent / https://$name/
+       </VirtualHost>
 
-       <Virtualhost <%= vhost_listen %>:443 >
+       <Virtualhost <%= vhost_listen_443 %> >
                ServerName $name
                ServerAdmin debian-admin@lists.debian.org