X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Fmanifests%2Fmirror_health.pp;h=41a970d783d473ad0cdd53ddc52c01ea5bfd9cb2;hb=5bdfb10702fc3322b473233f33113427e26aebf9;hp=2a0413bb07bf55dfec5f2b1cada43fe7edbabd67;hpb=2541e06afe1999dd5e81d4b9d0a670c579b6e460;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/manifests/mirror_health.pp b/modules/roles/manifests/mirror_health.pp index 2a0413bb0..41a970d78 100644 --- a/modules/roles/manifests/mirror_health.pp +++ b/modules/roles/manifests/mirror_health.pp @@ -2,20 +2,20 @@ define roles::mirror_health ( $check_hosts = [], $check_service = '', $url = '', + $health_url = '', $check_interval = 60, ) { - package { 'python3-requests': - ensure => installed, - } + ensure_packages(['python3-requests'], { ensure => 'installed' }) - # XXX: avoid duplicating this? - file { '/usr/local/sbin/mirror-health': - source => 'puppet:///modules/roles/mirror_health/mirror-health', - owner => 'root', - group => 'root', - mode => '0555', - notify => Service["mirror-health-${check_service}"], - } + if !defined(File['/usr/local/sbin/mirror-health']) { + file { '/usr/local/sbin/mirror-health': + source => 'puppet:///modules/roles/mirror_health/mirror-health', + owner => 'root', + group => 'root', + mode => '0555', + notify => Service["mirror-health-${check_service}"], + } + } file { "/etc/systemd/system/mirror-health-${check_service}.service": owner => 'root', @@ -32,6 +32,7 @@ define roles::mirror_health ( } service { "mirror-health-${check_service}": - ensure => running, + require => Exec['systemctl daemon-reload'], + ensure => running, } }