Make ports mirror template use an @archive_root and @archive_cd_root variable defined...
authorPeter Palfrader <peter@palfrader.org>
Tue, 12 Sep 2017 09:47:04 +0000 (09:47 +0000)
committerPeter Palfrader <peter@palfrader.org>
Tue, 12 Sep 2017 09:47:04 +0000 (09:47 +0000)
modules/roles/manifests/ports_mirror.pp
modules/roles/templates/apache-ftp.ports.debian.org.erb

index a2f5bfa..80ca8b5 100644 (file)
@@ -11,6 +11,12 @@ class roles::ports_mirror {
                mirror-isc => '149.20.4.15',
                default    => undef,
        }
+       $archive_root = $::hostname ? {
+               default    => '/srv/mirrors/debian-ports',
+       }
+       $archive_cd_root = $::hostname ? {
+               default    => '/srv/mirrors/debian-ports-cd',
+       }
 
        apache2::site { '010-ftp.ports.debian.org':
                site   => 'ftp.ports.debian.org',
index a9d4058..1479916 100644 (file)
 
        RedirectMatch "^/$" /debian-ports/
 
-       Alias /debian-ports /srv/mirrors/debian-ports
-       Use ftp-archive /srv/mirrors/debian-ports
+       Alias /debian-ports <%= @archive_root %>
+       Use ftp-archive <%= @archive_root %>
 
-       Alias /debian-ports-cd /srv/mirrors/debian-ports-cd
-       <Directory /srv/mirrors/debian-ports-cd>
+       Alias /debian-ports-cd <%= @archive_cd_root %>
+       <Directory <%= @archive_cd_root %>>
                Require all granted
                Options +Indexes
                Options +FollowSymLinks