--- /dev/null
+class roles::mirror_health (
+ $check_hosts = [],
+ $check_service = '',
+ $url = '',
+ $check_interval = 60,
+) {
+ package { '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',
+ }
+
+ 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'],
+ }
+
+ file { "/etc/systemd/system/multi-user.target.wants/mirror-health-${check_service}.service":
+ ensure => 'link',
+ target => "../mirror-health-${check_service}.service",
+ notify => Exec['systemctl daemon-reload'],
+ }
+}