Move debug healthcheck info to hiera
authorPeter Palfrader <peter@palfrader.org>
Sun, 22 Sep 2019 12:48:08 +0000 (14:48 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 22 Sep 2019 12:48:08 +0000 (14:48 +0200)
data/common.yaml
data/nodes/mirror-accumu.debian.org.yaml
data/nodes/schmelzer.debian.org.yaml
modules/mirror_health/manifests/service.pp
modules/roles/manifests/debug_mirror.pp

index 6c569ed..234bf02 100644 (file)
@@ -124,15 +124,6 @@ roles:
         - '[2a02:16a8:dc41:100::232]:80'
       fastly-backend: true
       service-hostname: conova.debian.backend.mirrors.debian.org
-  debug_mirror:
-    # XXX still used by the mirror health stuff
-    mirror-accumu.debian.org:
-      service-hostname: accumu.debug.backend.mirrors.debian.org
-    schmelzer.debian.org:
-      service-hostname: conova.debug.backend.mirrors.debian.org
-  debug_mirror_onion:
-    - mirror-accumu.debian.org
-    - schmelzer.debian.org
   bgp:
     - mirror-accumu.debian.org
     - mirror-skroutz.debian.org
index 2f885b9..92bf38e 100644 (file)
@@ -3,3 +3,4 @@ classes:
   - roles::debug_mirror
 
 roles::debug_mirror::onion_service: true
+roles::debug_mirror::healthcheck_name: accumu.debug.backend.mirrors.debian.org
index bfff689..dd405fd 100644 (file)
@@ -6,6 +6,7 @@ classes:
 
 roles::debug_mirror::listen_addr: ['217.196.149.232', '2a02:16a8:dc41:100::232']
 roles::debug_mirror::onion_service: true
+roles::debug_mirror::healthcheck_name: conova.debug.backend.mirrors.debian.org
 roles::syncproxy::syncproxy_name: syncproxy4.eu.debian.org
 roles::syncproxy::listen_addr: ['217.196.149.237', '2a02:16a8:dc41:100::237']
 roles::historical_mirror::listen_addr: ['217.196.149.234', '2a02:16a8:dc41:100::234']
index 312a63d..e302f80 100644 (file)
@@ -1,8 +1,8 @@
 # base class for Debian's mirror-health checker
 define mirror_health::service (
-  String $this_host_service_name,
   String $url,
   String $health_url,
+  String $this_host_service_name = $::fqdn,
   String $check_service = $name,
   Integer $check_interval = 60,
   Enum['present','absent'] $ensure = 'present',
index 38983c0..4975c41 100644 (file)
@@ -2,9 +2,11 @@
 #
 # @param listen_addr IP addresses to have apache listen on
 # @param onion_service provide the onion service from this host
+# @param healthcheck_name name to access this node in the health checker
 class roles::debug_mirror(
   Array[Stdlib::IP::Address] $listen_addr = [],
   Boolean $onion_service = false,
+  Optional[String] $healthcheck_name = undef,
 ) {
   include roles::archvsync_base
   include apache2
@@ -41,8 +43,13 @@ class roles::debug_mirror(
 
   Ferm::Rule::Simple <<| tag == 'ssh::server::from::ftp_master' |>>
 
+  $healthcheck_ensure = $healthcheck_name == undef ? {
+    true    => 'absent',
+    default => 'present',
+  }
   mirror_health::service { 'debug':
-    this_host_service_name => hiera('roles.debug_mirror')[$::fqdn]['service-hostname'],
+    ensure                 => healthcheck_ensure,
+    this_host_service_name => $healthcheck_name,
     url                    => 'http://debug.backend.mirrors.debian.org/debian-debug/dists/sid-debug/Release',
     health_url             => 'http://debug.backend.mirrors.debian.org/_health',
   }