From 7bc84407c3515da0f59520eea5e96f18b2dd3b1e Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Fri, 2 Feb 2018 08:03:12 +0100 Subject: [PATCH] Avoid redeclaring the mirror-health file resource --- modules/roles/manifests/mirror_health.pp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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', -- 2.20.1