Do not ship sbin/mirror-health from the roles version while we migrate
[mirror/dsa-puppet.git] / modules / roles / manifests / mirror_health.pp
index a00f0a4..d4d0d62 100644 (file)
@@ -2,26 +2,27 @@ 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',
-       }
+#      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',
                group   => 'root',
                mode    => '0444',
                 content => template('roles/mirror-health.service.erb'),
-                notify  => Exec['systemctl daemon-reload'],
+                notify  => [Exec['systemctl daemon-reload'], Service["mirror-health-${check_service}"]],
         }
 
         file { "/etc/systemd/system/multi-user.target.wants/mirror-health-${check_service}.service":
@@ -31,6 +32,7 @@ define roles::mirror_health (
        }
 
        service { "mirror-health-${check_service}":
-               ensure => running,
+               require => Exec['systemctl daemon-reload'],
+               ensure  => running,
         }
 }