From 4d2899b5f8a64ac9e579ce759c759bb6966a357c Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 12 Dec 2012 14:14:20 -0500 Subject: [PATCH] puppet: Add postgres config (imported from commit ca932a1a1af7e7236ff1f47785acf4b412b16650) --- servers/puppet/manifests/site.pp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/servers/puppet/manifests/site.pp b/servers/puppet/manifests/site.pp index 1d6d97e82f..e897ddcfa5 100644 --- a/servers/puppet/manifests/site.pp +++ b/servers/puppet/manifests/site.pp @@ -297,8 +297,39 @@ class humbug_nagios { #TODO: Need to install our Nagios config } +class humbug_postgres { + $postgres_packages = [ "postgresql-9.1", "pgtune", ] + package { $postgres_packages: ensure => "installed" } + + file { '/etc/sysctl.d/30-postgresql-shm.conf': + ensure => file, + owner => root, + group => root, + mode => 644 + } + + common::append_if_no_such_line { 'shmmax': + require => Package['postgresql-9.1'], + file => '/etc/sysctl.d/30-postgresql-shm.conf', + line => 'kernel.shmmax = 6979321856' + } + common::append_if_no_such_line { 'shmall': + require => Package['postgresql-9.1'], + file => '/etc/sysctl.d/30-postgresql-shm.conf', + line => 'kernel.shmall = 1703936' + } + + exec { "sysctl_p": + command => "sysctl -p /etc/sysctl.d/30-postgresql-shm.conf", + require => [ Common::Append_if_no_such_line['shmmax'], + Common::Append_if_no_such_line['shmall'], + ], + } +} + class { "humbug_base": } #class { "humbug_apache_base": } #class { "humbug_wiki": } #class { "humbug_app_frontend": } #class { "humbug_database": } +#class { "humbug_postgres": }