X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fmirror_health%2Fmanifests%2Fservice.pp;h=fced5182cf7c789ed10a2a152ee80f8dfafa6bae;hb=3e90518da89b965f76fbc7e58141c37e37c187bd;hp=312a63db5de38dc47467b2439381fd8821a0b622;hpb=0b6cb05ea797df93a05d5ba0d3ec549f16f7063d;p=mirror%2Fdsa-puppet.git diff --git a/modules/mirror_health/manifests/service.pp b/modules/mirror_health/manifests/service.pp index 312a63db5..fced5182c 100644 --- a/modules/mirror_health/manifests/service.pp +++ b/modules/mirror_health/manifests/service.pp @@ -1,8 +1,25 @@ -# base class for Debian's mirror-health checker +# service instance for Debian's mirror-health checker +# +# for each defined service, a daemon will regularly check if the +# local version of matches the majority version among the +# set of all hosts that define a . +# +# the result of this check is then exposed via +# +# @param url URL to check for freshness on each host (normally a Release file) +# @param health_url URL to the health marker +# @param this_host_service_name this host's service name for this service. +# Other nodes will connect to this hostname to +# fetch url for checking. +# If this is undef, other hosts will not +# check this host. +# @param check_service name of this service +# @param check_interval how often to check +# @param ensure present or absent define mirror_health::service ( - String $this_host_service_name, String $url, String $health_url, + Optional[String] $this_host_service_name = undef, String $check_service = $name, Integer $check_interval = 60, Enum['present','absent'] $ensure = 'present', @@ -49,10 +66,12 @@ define mirror_health::service ( mode => '0444', notify => Service["mirror-health-${check_service}"], } - @@concat::fragment { "mirror_health::service::${check_service}::hosts::${this_host_service_name}": - tag => $tag, - target => $hosts_file, - content => $this_host_service_name, + if $this_host_service_name and $ensure == 'present' { + @@concat::fragment { "mirror_health::service::${check_service}::hosts::${this_host_service_name}": + tag => $tag, + target => $hosts_file, + content => $this_host_service_name, + } } Concat::Fragment <<| tag == $tag |>> }