make a hiera setting for mirror base directory (/srv/mirrors)
authorPeter Palfrader <peter@palfrader.org>
Tue, 12 Sep 2017 11:53:01 +0000 (11:53 +0000)
committerPeter Palfrader <peter@palfrader.org>
Tue, 12 Sep 2017 11:53:01 +0000 (11:53 +0000)
hieradata/common.yaml
modules/roles/manifests/debian_mirror.pp
modules/roles/manifests/debug_mirror.pp
modules/roles/manifests/historical_mirror.pp
modules/roles/manifests/ports_mirror.pp

index 22f6046..3201ad5 100644 (file)
@@ -3,6 +3,8 @@ nameservers: []
 searchpaths: []
 resolvoptions: []
 allow_dns_query: []
+role_config__mirrors:
+  mirror_basedir_prefix: '/srv/mirrors/'
 role_config__syncproxy:
   mirror_basedir_prefix: '/srv/mirrors/'
 roles:
index f6e5696..1eae310 100644 (file)
@@ -1,6 +1,9 @@
 class roles::debian_mirror {
        include roles::archvsync_base
 
+       $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
+       $archive_root = "${mirror_basedir_prefix}debian"
+
        $vhost_listen = join([
                $::hostname ? {
                        klecker    => '130.89.148.12:80 [2001:610:1908:b000::148:12]:80 [2001:67c:2564:a119::148:12]:80',
@@ -19,9 +22,6 @@ class roles::debian_mirror {
                mirror-isc => '149.20.4.15',
                default    => undef,
        }
-       $archive_root = $::hostname ? {
-               default    => '/srv/mirrors/debian',
-       }
 
        apache2::site { '010-ftp.debian.org':
                site   => 'ftp.debian.org',
index 4e9c673..828ee60 100644 (file)
@@ -1,6 +1,9 @@
 class roles::debug_mirror {
        include roles::archvsync_base
 
+       $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
+       $archive_root = "${mirror_basedir_prefix}debian-debug"
+
        $vhost_listen = $::hostname ? {
                klecker    => '130.89.148.14:80 [2001:610:1908:b000::148:14]:80 [2001:67c:2564:a119::148:14]:80',
                mirror-isc => '149.20.4.15:80 [2001:4f8:1:c::15]:80',
@@ -12,9 +15,6 @@ class roles::debug_mirror {
                mirror-isc => '149.20.4.15',
                default    => undef,
        }
-       $archive_root = $::hostname ? {
-               default    => '/srv/mirrors/debian-debug',
-       }
 
        apache2::site { '010-debug.mirrors.debian.org':
                site   => 'debug.mirrors.debian.org',
index eb3230a..e3ed4ef 100644 (file)
@@ -2,6 +2,9 @@ class roles::historical_mirror {
        include roles::archvsync_base
        include apache2::expires
 
+       $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
+       $archive_root = "${mirror_basedir_prefix}debian-archive"
+
        $binds = $::hostname ? {
                gretchaninov  => ['209.87.16.41'   , '[2607:f8f0:614:1::1274:41]'          ],
                klecker       => ['130.89.148.13'  , '[2001:610:1908:b000::148:13]',
@@ -14,9 +17,6 @@ class roles::historical_mirror {
        $onion_v4_addr = $::hostname ? {
                default    => undef,
        }
-       $archive_root = $::hostname ? {
-               default    => '/srv/mirrors/debian-archive',
-       }
 
        apache2::site { '010-archive.debian.org':
                site   => 'archive.debian.org',
index 80ca8b5..65a1ad9 100644 (file)
@@ -1,6 +1,10 @@
 class roles::ports_mirror {
        include roles::archvsync_base
 
+       $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
+       $archive_root = "${mirror_basedir_prefix}debian-ports"
+       $archive_cd_root = "${mirror_basedir_prefix}debian-ports-cd"
+
        $vhost_listen = $::hostname ? {
                klecker    => '130.89.148.14:80 [2001:610:1908:b000::148:14]:80 [2001:67c:2564:a119::148:14]:80',
                mirror-isc => '149.20.4.15:80 [2001:4f8:1:c::15]:80',
@@ -11,12 +15,6 @@ 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',