remove postgres things if we do not have postgresql
[mirror/dsa-puppet.git] / modules / postgres / manifests / init.pp
index bb2b768..af2f206 100644 (file)
@@ -1,19 +1,30 @@
 class postgres {
-    activate_munin_check {
-        "postgres_bgwriter":;
-        "postgres_connections_db":;
-        "postgres_cache_ALL": script => "postgres_cache_";
-        "postgres_querylength_ALL": script => "postgres_querylength_";
-        "postgres_size_ALL": script => "postgres_size_";
-    }
-    file {
-        "/etc/munin/plugin-conf.d/local-postgres":
-            source  => "puppet:///modules/postgres/plugin.conf",
-            ;
-    }
-}
+       $ensure = ($::postgres) ? {
+               true    => 'ensure',
+               default => 'absent'
+       }
 
-# vim:set et:
-# vim:set sts=4 ts=4:
-# vim:set shiftwidth=4:
+       munin::check { 'postgres_bgwriter':
+               ensure => $ensure,
+               }
+       munin::check { 'postgres_connections_db':
+               ensure => $ensure,
+               }
+       munin::check { 'postgres_cache_ALL':
+               ensure => $ensure,
+               script => 'postgres_cache_'
+       }
+       munin::check { 'postgres_querylength_ALL':
+               ensure => $ensure,
+               script => 'postgres_querylength_'
+       }
+       munin::check { 'postgres_size_ALL':
+               ensure => $ensure,
+               script => 'postgres_size_'
+       }
 
+       file { '/etc/munin/plugin-conf.d/local-postgres':
+               ensure => $ensure,
+               source  => 'puppet:///modules/postgres/plugin.conf',
+       }
+}