From: Peter Palfrader Date: Tue, 12 Sep 2017 11:53:01 +0000 (+0000) Subject: make a hiera setting for mirror base directory (/srv/mirrors) X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=b244b8852b6824886daaa28c76c3fda13f029ed9;p=mirror%2Fdsa-puppet.git make a hiera setting for mirror base directory (/srv/mirrors) --- diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 22f6046e5..3201ad525 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -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: diff --git a/modules/roles/manifests/debian_mirror.pp b/modules/roles/manifests/debian_mirror.pp index f6e569622..1eae31085 100644 --- a/modules/roles/manifests/debian_mirror.pp +++ b/modules/roles/manifests/debian_mirror.pp @@ -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', diff --git a/modules/roles/manifests/debug_mirror.pp b/modules/roles/manifests/debug_mirror.pp index 4e9c67304..828ee60a1 100644 --- a/modules/roles/manifests/debug_mirror.pp +++ b/modules/roles/manifests/debug_mirror.pp @@ -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', diff --git a/modules/roles/manifests/historical_mirror.pp b/modules/roles/manifests/historical_mirror.pp index eb3230a37..e3ed4ef6c 100644 --- a/modules/roles/manifests/historical_mirror.pp +++ b/modules/roles/manifests/historical_mirror.pp @@ -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', diff --git a/modules/roles/manifests/ports_mirror.pp b/modules/roles/manifests/ports_mirror.pp index 80ca8b5d5..65a1ad97b 100644 --- a/modules/roles/manifests/ports_mirror.pp +++ b/modules/roles/manifests/ports_mirror.pp @@ -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',