From: Tollef Fog Heen Date: Fri, 2 Feb 2018 07:03:12 +0000 (+0100) Subject: Avoid redeclaring the mirror-health file resource X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=7bc84407c3515da0f59520eea5e96f18b2dd3b1e;p=mirror%2Fdsa-puppet.git Avoid redeclaring the mirror-health file resource --- diff --git a/modules/roles/manifests/mirror_health.pp b/modules/roles/manifests/mirror_health.pp index ebc195ea4..41a970d78 100644 --- a/modules/roles/manifests/mirror_health.pp +++ b/modules/roles/manifests/mirror_health.pp @@ -7,14 +7,15 @@ define roles::mirror_health ( ) { 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',