remove anchor dependency - fixed #26
authormh <mh@immerda.ch>
Sun, 3 Nov 2013 16:55:54 +0000 (17:55 +0100)
committermh <mh@immerda.ch>
Sun, 3 Nov 2013 16:55:54 +0000 (17:55 +0100)
given that all os are using package installation now, we can replace
the anchor with the package dependency. It also caused a dependency
cycle as the anchor was for the whole class and not only the package
installation.

manifests/client.pp
manifests/plugins/setup.pp

index b7cd5d4..2d4c82b 100644 (file)
@@ -12,39 +12,14 @@ class munin::client(
   $shorewall_collector_source = 'net',
   $export_tag = 'munin'
 ) {
-  anchor { 'munin::client::installed': }
 
   case $::operatingsystem {
-    openbsd: {
-      class { 'munin::client::openbsd':
-        before => Anchor['munin::client::installed']
-      }
-    }
-    darwin: {
-      class { 'munin::client::darwin':
-        before => Anchor['munin::client::installed']
-      }
-    }
-    debian,ubuntu: {
-      class { 'munin::client::debian':
-        before => Anchor['munin::client::installed']
-      }
-    }
-    gentoo: {
-      class { 'munin::client::gentoo':
-        before => Anchor['munin::client::installed']
-      }
-    }
-    centos: {
-      class { 'munin::client::base':
-        before => Anchor['munin::client::installed']
-      }
-    }
-    default: {
-      class { 'munin::client::base':
-        before => Anchor['munin::client::installed']
-      }
-    }
+    openbsd: { include munin::client::openbsd }
+    darwin: { include munin::client::darwin }
+    debian,ubuntu: { include munin::client::debian }
+    gentoo: { include munin::client::gentoo }
+    centos: { include munin::client::base }
+    default: { include munin::client::base }
   }
   if $munin::client::manage_shorewall {
     class{'shorewall::rules::munin':
index e1a57d9..23222ec 100644 (file)
@@ -4,7 +4,7 @@ class munin::plugins::setup {
   file {
     [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
       ensure    => directory,
-      require   => Anchor['munin::client::installed'],
+      require   => Package['munin-node'],
       ignore    => 'snmp_*',
       checksum  => mtime,
       recurse   => true,
@@ -16,7 +16,7 @@ class munin::plugins::setup {
       mode      => '0755';
     '/etc/munin/plugin-conf.d/munin-node':
       ensure    => present,
-      require   => Anchor['munin::client::installed'],
+      require   => Package['munin-node'],
       notify    => Service['munin-node'],
       owner     => root,
       group     => 0,