From 84d0b284fff6d91fc155705191408c8901719ab2 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 18 Mar 2017 19:46:20 +0100 Subject: [PATCH] remove postgres things if we do not have postgresql --- manifests/site.pp | 5 +---- modules/postgres/manifests/init.pp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index 55d18f819..8e72e7d33 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -41,6 +41,7 @@ node default { include multipath include popcon include portforwarder + include postgres if $::lsbdistcodename == squeeze { include roles::udldap::client @@ -114,10 +115,6 @@ node default { include debian_org::radvd } - if ($::postgres) { - include postgres - } - if $::spamd { munin::check { 'spamassassin': } } diff --git a/modules/postgres/manifests/init.pp b/modules/postgres/manifests/init.pp index 4edc5c8a6..af2f206d5 100644 --- a/modules/postgres/manifests/init.pp +++ b/modules/postgres/manifests/init.pp @@ -1,17 +1,30 @@ class postgres { - munin::check { 'postgres_bgwriter': } - munin::check { 'postgres_connections_db': } + $ensure = ($::postgres) ? { + true => 'ensure', + default => 'absent' + } + + 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', } } -- 2.20.1