X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpostgres%2Fmanifests%2Finit.pp;h=d146310122ef13d72dced532f67349b2041cfe2e;hb=b07d4828f3f22e9f4c80709ce2948174f9c1124f;hp=bb2b7689ed92c4738145afe56870ade16eed1c01;hpb=3817334616fc4370c954be504023014709fe38da;p=mirror%2Fdsa-puppet.git diff --git a/modules/postgres/manifests/init.pp b/modules/postgres/manifests/init.pp index bb2b7689e..d14631012 100644 --- a/modules/postgres/manifests/init.pp +++ b/modules/postgres/manifests/init.pp @@ -1,19 +1,36 @@ +# 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 => 'present', + 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', + } + file { '/usr/local/sbin/dsa-restart-all-idle-postgres': + ensure => $ensure, + source => 'puppet:///modules/postgres/dsa-restart-all-idle-postgres', + mode => '0555', + } +}