Merge remote-tracking branch 'origin/master' into staging
[mirror/dsa-puppet.git] / modules / roles / manifests / mirror_health.pp
index ec1102d..41a970d 100644 (file)
@@ -5,18 +5,17 @@ define roles::mirror_health (
        $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',