From 26224742940b06335bca3cb8f5e09d0c0a5cabef Mon Sep 17 00:00:00 2001
From: Tomas Barton <barton.tomas@gmail.com>
Date: Sun, 13 Oct 2013 20:24:20 +0200
Subject: Class[] -> Class[] requirement replaced by an anchor

---
 manifests/client.pp        | 38 ++++++++++++++++++++++++++++++++------
 manifests/plugins/setup.pp |  5 ++---
 2 files changed, 34 insertions(+), 9 deletions(-)

(limited to 'manifests')

diff --git a/manifests/client.pp b/manifests/client.pp
index 4d70cac..c33ec0d 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -12,13 +12,39 @@ class munin::client(
   $shorewall_collector_source = 'net',
   $export_tag = 'munin'
 ) {
+  anchor { 'munin::client::installed': }
+
   case $::operatingsystem {
-    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::package }
-    default: { include munin::client::base }
+    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::package':
+        before => Anchor['munin::client::installed']
+      }
+    }
+    default: {
+      class { 'munin::client::base':
+        before => Anchor['munin::client::installed']
+      }
+    }
   }
   if $munin::client::manage_shorewall {
     class{'shorewall::rules::munin':
diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp
index e0826f0..e1a57d9 100644
--- a/manifests/plugins/setup.pp
+++ b/manifests/plugins/setup.pp
@@ -1,12 +1,10 @@
 # Set up the munin plugins for a node
 class munin::plugins::setup {
 
-  # This is required for the munin-node service and package requirements below.
-  Class['munin::client'] -> Class['munin::plugins::setup']
-
   file {
     [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
       ensure    => directory,
+      require   => Anchor['munin::client::installed'],
       ignore    => 'snmp_*',
       checksum  => mtime,
       recurse   => true,
@@ -18,6 +16,7 @@ class munin::plugins::setup {
       mode      => '0755';
     '/etc/munin/plugin-conf.d/munin-node':
       ensure    => present,
+      require   => Anchor['munin::client::installed'],
       notify    => Service['munin-node'],
       owner     => root,
       group     => 0,
-- 
cgit v1.2.3