Skip to content

Commit

Permalink
Merge pull request voxpupuli#419 from treydock/reload
Browse files Browse the repository at this point in the history
Execute systemctl daemon-reload before restarting daemons
  • Loading branch information
bastelfreak authored Jan 25, 2020
2 parents 35aa8c5 + c4c751d commit dc59985
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions manifests/daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
4 changes: 4 additions & 0 deletions spec/defines/daemon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit dc59985

Please sign in to comment.