Dzahn has submitted this change and it was merged.
Change subject: ganglia: fix aggregator config/service dependency
......................................................................
ganglia: fix aggregator config/service dependency
If the site is not a monitored site and we don't create a service
for it, also don't try to have it as a dependency on the configuration file,
to avoid puppet dependency errors.
Change-Id: I9277fe05788114e76b4d719542dca0549a7192d5
---
M modules/ganglia/manifests/monitor/aggregator/instance.pp
1 file changed, 11 insertions(+), 14 deletions(-)
Approvals:
jenkins-bot: Verified
Dzahn: Looks good to me, approved
diff --git a/modules/ganglia/manifests/monitor/aggregator/instance.pp
b/modules/ganglia/manifests/monitor/aggregator/instance.pp
index dca74ad..e364aab 100644
--- a/modules/ganglia/manifests/monitor/aggregator/instance.pp
+++ b/modules/ganglia/manifests/monitor/aggregator/instance.pp
@@ -23,11 +23,6 @@
$desc_safe = regsubst($desc, '/', '_', 'G')
$gmond_port = $ganglia::configuration::base_port + $id
$cname = "${desc_safe} ${::site}"
- if $monitored_site in $sites {
- $ensure = 'present'
- } else {
- $ensure = 'absent'
- }
# This will only be realized if base::firewall (well ferm..) is included
ferm::rule { "aggregator-udp-${id}":
@@ -48,18 +43,20 @@
default => 'ganglia-monitor-aggregator',
}
- file { "/etc/ganglia/aggregators/${id}.conf":
- ensure => $ensure,
- require => File['/etc/ganglia/aggregators'],
- mode => '0444',
- content => template("${module_name}/gmond.conf.erb"),
- notify => Service[$aggsvcname],
- }
-
# on systemd each instance is a separate service
# which is spawned from a common service template
- # and we only want to run it if the site is a monitored site
+ # and we only want to run it and create the config
+ # if the site is a monitored site
if $monitored_site in $sites {
+
+ file { "/etc/ganglia/aggregators/${id}.conf":
+ ensure => 'present',
+ require => File['/etc/ganglia/aggregators'],
+ mode => '0444',
+ content => template("${module_name}/gmond.conf.erb"),
+ notify => Service[$aggsvcname],
+ }
+
if $::initsystem == 'systemd' {
service { "ganglia-monitor-aggregator@${id}.service":
ensure => running,
--
To view, visit https://gerrit.wikimedia.org/r/285299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9277fe05788114e76b4d719542dca0549a7192d5
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits