Skip to content

Commit c97f032

Browse files
authored
Merge pull request #19 from DaveHewy/newrelic-infra-service-mods
Add simple control mods for newrelic-infra service resource
2 parents 35daa25 + 70d7f55 commit c97f032

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

manifests/infra.pp

+28-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
# Whether to install the NewRelic OS repositories
1313
# Default: Varies depending on OS (Boolean)
1414
#
15+
# [*manage_service*]
16+
# Whether or not to manage the service as part of this module
17+
# Default: true (Boolean)
18+
#
19+
# [*service_ensure*]
20+
# State of the $service_name (newrelic-infra) service
21+
# Default: running (String)
22+
#
23+
# [*service_name*]
24+
# Name of the newrelic infra service
25+
# Default: newrelic-infra (String)
26+
#
27+
# [*service_enable*]
28+
# Whether to enable the service at boot
29+
# Default: true (Boolean)
30+
#
1531
# === Authors
1632
#
1733
# Russell Whelan <[email protected]>
@@ -23,7 +39,11 @@
2339
#
2440
class newrelic::infra (
2541
String $license_key,
26-
Boolean $manage_repo = $::newrelic::params::manage_repo,
42+
Boolean $manage_repo = $::newrelic::params::manage_repo,
43+
Boolean $manage_service = true,
44+
String $service_ensure = 'running',
45+
String $service_name = 'newrelic-infra',
46+
Boolean $service_enable = true
2747
) inherits newrelic::params {
2848

2949
if $facts['os']['family'] == 'Windows' {
@@ -48,9 +68,12 @@
4868
require => File['/etc/newrelic-infra.yml'],
4969
}
5070
51-
service { 'newrelic-infra':
52-
ensure => running,
53-
require => Package['newrelic-infra']
71+
if $manage_service {
72+
service { $service_name:
73+
ensure => $service_ensure,
74+
name => $service_name,
75+
enable => $service_enable,
76+
require => Package['newrelic-infra']
77+
}
5478
}
55-
5679
}

0 commit comments

Comments
 (0)