Skip to content

Commit

Permalink
need to disable service upstream when service set to absent
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Silva committed Oct 15, 2024
1 parent c9567ec commit 6c143b3
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions manifests/forwarder/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
# sub-classes
#
class splunk::forwarder::service {
service { $splunk::forwarder::service_name:
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
if $splunk::forwarder::package_ensure == absent {
service { $splunk::forwarder::service_name:
ensure => stopped,
enable => false,
hasstatus => false,
hasrestart => false,
}
} else {
service { $splunk::forwarder::service_name:
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
}
}
}

0 comments on commit 6c143b3

Please sign in to comment.