Skip to content

Commit

Permalink
Remove systemd module dependency and fix missing path for a exec (#58)
Browse files Browse the repository at this point in the history
* Remove systemd module dependency

camptocamp/systemd only replaces a single exec but can cause conflicts
with the many other systemd puppet modules around.

* fix missing path for an exec
  • Loading branch information
juliantaylor authored and wyardley committed Sep 14, 2017
1 parent f7deced commit 12b68e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ 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}"
11 changes: 8 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@

# 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['systemctl-daemon-reload'], Class['::prometheus::run_service']]
$systemd_notify = [Exec['prometheus-systemd-reload'], Class['::prometheus::run_service']]
} else {
$systemd_notify = Exec['systemctl-daemon-reload']
$systemd_notify = Exec['prometheus-systemd-reload']
}

case $prometheus::init_style {
Expand All @@ -46,6 +45,12 @@
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
1 change: 1 addition & 0 deletions manifests/service_reload.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

exec { 'prometheus-reload':
command => $prometheus_reload,
path => [ '/usr/bin', '/bin', '/usr/sbin' ],
refreshonly => true,
}
}
Expand Down
4 changes: 0 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"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 12b68e0

Please sign in to comment.