Faidon Liambotis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/178404

Change subject: ganglia: remove legacy gmond compatibility stanzas
......................................................................

ganglia: remove legacy gmond compatibility stanzas

The "ganglia-monitor" package was named "gmond" in Ubuntu < 9.10 and had
a different config file path & init script name.

Surprisingly, we still had quite the complicated manifest to account for
this and change the behavior accordingly. Drop all this and rely just on
ganglia-monitor. As Service['gmond'] is still being used across the
tree, keep a Service alias for now.

Change-Id: I7c59993ab9a019e5dce39661e72523e8ec508f66
---
M manifests/ganglia.pp
1 file changed, 20 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/178404/1

diff --git a/manifests/ganglia.pp b/manifests/ganglia.pp
index 5edd4d1..1c96d60 100644
--- a/manifests/ganglia.pp
+++ b/manifests/ganglia.pp
@@ -170,72 +170,38 @@
         $clustername = $ganglia_clusters[$cluster][name]
         $cname = "${clustername}${name_suffix}"
 
-        if versioncmp($::lsbdistrelease, '9.10') >= 0 {
-            $gmond = 'ganglia-monitor'
-        }
-        else {
-            $gmond = 'gmond'
-        }
-
-        $gmondpath = $gmond ? {
-            'ganglia-monitor'       => '/etc/ganglia/gmond.conf',
-            default                 => '/etc/gmond.conf'
-        }
-
-
         # Resource definitions
-        file { 'gmondconfig':
+        file { '/etc/ganglia/gmond.conf':
             ensure  => present,
-            require => Package[$gmond],
-            name    => $gmondpath,
+            require => Package['ganglia-monitor'],
             owner   => 'root',
             group   => 'root',
             mode    => '0444',
             content => template('ganglia/gmond_template.erb'),
-            notify  => Service['gmond'],
+            notify  => Service['ganglia-monitor'],
         }
 
-        case $gmond {
-            gmond: {
-                package { 'gmond':
-                    ensure => latest,
-                    alias  => 'gmond-package',
-                }
-                package { 'ganglia-monitor':
-                    ensure => purged,
-                    before => Package['gmond'],
-                }
-            }
-            ganglia-monitor: {
-                if !defined(Package['ganglia-monitor']) {
-                    package { 'gmond':
-                        ensure => purged,
-                        before => Package['ganglia-monitor'],
-                    }
-                    package { 'ganglia-monitor':
-                        ensure => present,
-                        alias  => 'gmond-package',
-                    }
-                }
-
-                file { [ '/etc/ganglia/conf.d', 
'/usr/lib/ganglia/python_modules' ]:
-                    ensure  => directory,
-                    require => Package['ganglia-monitor'],
-                }
-
-                file { '/etc/gmond.conf':
-                    ensure => absent,
-                }
+        if !defined(Package['ganglia-monitor']) {
+            package { 'ganglia-monitor':
+                ensure => present,
             }
         }
 
-        service { 'gmond':
+        file { [ '/etc/ganglia/conf.d', '/usr/lib/ganglia/python_modules' ]:
+            ensure  => directory,
+            require => Package['ganglia-monitor'],
+        }
+
+        service { 'ganglia-monitor':
             ensure    => running,
-            name      => $gmond,
-            require   => [ File['gmondconfig'], Package['gmond-package'] ],
-            subscribe => File['gmondconfig'],
+            require   => [
+                File['/etc/ganglia/gmond.conf'],
+                Package['ganglia-monitor']
+            ],
+            subscribe => File['/etc/ganglia/gmond.conf'],
             hasstatus => false,
             pattern   => 'gmond',
+            alias     => 'gmond',
         }
 
         group { 'gmetric':
@@ -651,14 +617,14 @@
         group  => 'root',
         mode   => '0444',
         source => "puppet:///files/ganglia/plugins/${plugin}.py",
-        notify => Service['gmond'],
+        notify => Service['ganglia-monitor'],
     }
     file { "/etc/ganglia/conf.d/${plugin}.pyconf":
         owner   => 'root',
         group   => 'root',
         mode    => '0444',
         content => template("ganglia/plugins/${plugin}.pyconf.erb"),
-        notify  => Service['gmond'],
+        notify  => Service['ganglia-monitor'],
     }
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/178404
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c59993ab9a019e5dce39661e72523e8ec508f66
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to