Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute systemctl daemon-reload before restarting daemons #419

Merged
merged 1 commit into from
Jan 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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