Skip to content

Commit

Permalink
Replaced internal systemd reload with external systemd module's one
Browse files Browse the repository at this point in the history
  • Loading branch information
vide committed Jun 23, 2017
1 parent feb8519 commit 00b9f23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ fixtures:
repositories:
archive: "https://github.com/voxpupuli/puppet-archive"
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib"
systemd: "https://github.com/camptocamp/puppet-systemd"
symlinks:
"prometheus": "#{source_dir}"
10 changes: 3 additions & 7 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@

# the vast majority of files here are init-files
# so any change there should trigger a full service restart
# systemd reload comes from the systemd module
if $::prometheus::restart_on_change {
File {
notify => [Class['::prometheus::run_service']],
}
$systemd_notify = [Exec['prometheus-systemd-reload'], Class['::prometheus::run_service']]
$systemd_notify = [Exec['systemctl-daemon-reload'], Class['::prometheus::run_service']]
} else {
$systemd_notify = Exec['prometheus-systemd-reload']
$systemd_notify = Exec['systemctl-daemon-reload']
}

case $prometheus::init_style {
Expand All @@ -45,11 +46,6 @@
notify => $systemd_notify,
content => template('prometheus/prometheus.systemd.erb'),
}
exec { 'prometheus-systemd-reload':
command => 'systemctl daemon-reload',
path => [ '/usr/bin', '/bin', '/usr/sbin' ],
refreshonly => true,
}
}
'sysv' : {
file { '/etc/init.d/prometheus':
Expand Down
4 changes: 4 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"name":"puppet/archive",
"version_requirement":">=1.3.0 <2.0.0"
},
{
"name":"camptocamp/systemd",
"version_requirement":">=0.4.0 <1.0.0"
},
{
"name":"puppetlabs/stdlib",
"version_requirement":">= 4.6.0 <5.0.0"
Expand Down

0 comments on commit 00b9f23

Please sign in to comment.