Skip to content

Commit

Permalink
don't start service in case the package is ensured absent
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed Feb 2, 2017
1 parent 5f4f210 commit d235a2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions manifests/node_exporter/service.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# == Class prometheus::node_exporter::service
#
class prometheus::node_exporter::service {
if $::prometheus::node_exporter::package_ensure == 'absent' {
$service_ensure ='stopped'
$service_enable = false
} else {
$service_ensure ='running'
$service_enable = true
}

service { 'node_exporter':
ensure => 'running',
enable => true,
ensure => $service_ensure,
enable => $service_enable,
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cristifalcas-prometheus",
"version": "1.5.0",
"version": "1.6.0",
"author": "Cristian Falcas",
"summary": "Prometheus Puppet module",
"license": "Apache-2.0",
Expand Down

0 comments on commit d235a2f

Please sign in to comment.