diff --git a/manifests/daemon.pp b/manifests/daemon.pp index 4c752b838..0988ce453 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -171,6 +171,11 @@ content => template('prometheus/daemon.systemd.erb'), notify => $notify_service, } + # Puppet 5 doesn't have https://tickets.puppetlabs.com/browse/PUP-3483 + # and camptocamp/systemd only creates this relationship when managing the service + if $manage_service and versioncmp($facts['puppetversion'],'6.1.0') < 0 { + Class['systemd::systemctl::daemon_reload'] -> Service[$name] + } } # service_provider returns redhat on CentOS using sysv, https://tickets.puppetlabs.com/browse/PUP-5296 'sysv','redhat': { diff --git a/spec/defines/daemon_spec.rb b/spec/defines/daemon_spec.rb index 546e537c3..857bd4587 100644 --- a/spec/defines/daemon_spec.rb +++ b/spec/defines/daemon_spec.rb @@ -149,6 +149,10 @@ ) } + if Gem::Version.new(facts[:puppetversion]) < Gem::Version.new('6.1.0') + it { is_expected.to contain_class('systemd::systemctl::daemon_reload').that_comes_before('Service[smurf_exporter]') } + end + context 'with overidden bin_name' do let(:params) do parameters.merge(bin_name: 'notsmurf_exporter')