From: Peter Palfrader Date: Sun, 22 Sep 2019 12:48:08 +0000 (+0200) Subject: Move debug healthcheck info to hiera X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=commitdiff_plain;h=648c3f71395624c4e75004e78523c145b1e68ebf Move debug healthcheck info to hiera --- diff --git a/data/common.yaml b/data/common.yaml index 6c569ed89..234bf02fa 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -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 diff --git a/data/nodes/mirror-accumu.debian.org.yaml b/data/nodes/mirror-accumu.debian.org.yaml index 2f885b964..92bf38ee7 100644 --- a/data/nodes/mirror-accumu.debian.org.yaml +++ b/data/nodes/mirror-accumu.debian.org.yaml @@ -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 diff --git a/data/nodes/schmelzer.debian.org.yaml b/data/nodes/schmelzer.debian.org.yaml index bfff68935..dd405fd0f 100644 --- a/data/nodes/schmelzer.debian.org.yaml +++ b/data/nodes/schmelzer.debian.org.yaml @@ -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'] diff --git a/modules/mirror_health/manifests/service.pp b/modules/mirror_health/manifests/service.pp index 312a63db5..e302f80c5 100644 --- a/modules/mirror_health/manifests/service.pp +++ b/modules/mirror_health/manifests/service.pp @@ -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', diff --git a/modules/roles/manifests/debug_mirror.pp b/modules/roles/manifests/debug_mirror.pp index 38983c0c0..4975c41d4 100644 --- a/modules/roles/manifests/debug_mirror.pp +++ b/modules/roles/manifests/debug_mirror.pp @@ -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', }