2013-02-07 22:20:10 +01:00
|
|
|
class humbug::postgres {
|
|
|
|
class { 'humbug::base': }
|
|
|
|
|
|
|
|
$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
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "/etc/postgresql/9.1/main/postgresql.conf":
|
|
|
|
require => Package["postgresql-9.1"],
|
|
|
|
ensure => file,
|
|
|
|
owner => "postgres",
|
|
|
|
group => "postgres",
|
|
|
|
mode => 644,
|
|
|
|
source => "/root/humbug/servers/puppet/files/postgresql/postgresql.conf",
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "/etc/postgresql/9.1/main/pg_hba.conf":
|
|
|
|
require => Package["postgresql-9.1"],
|
|
|
|
ensure => file,
|
|
|
|
owner => "postgres",
|
|
|
|
group => "postgres",
|
|
|
|
mode => 640,
|
|
|
|
source => "/root/humbug/servers/puppet/files/postgresql/pg_hba.conf",
|
|
|
|
}
|
|
|
|
|
2013-02-07 22:43:54 +01:00
|
|
|
common::line { 'shmmax':
|
|
|
|
require => [ Package['postgresql-9.1'],
|
|
|
|
File["/etc/sysctl.d/30-postgresql-shm.conf"] ],
|
2013-02-07 22:20:10 +01:00
|
|
|
file => '/etc/sysctl.d/30-postgresql-shm.conf',
|
2013-02-07 22:43:54 +01:00
|
|
|
line => 'kernel.shmmax = 6979321856',
|
2013-02-07 22:20:10 +01:00
|
|
|
}
|
2013-02-07 22:43:54 +01:00
|
|
|
|
|
|
|
common::line { 'shmall':
|
|
|
|
require => [ Package['postgresql-9.1'],
|
|
|
|
File["/etc/sysctl.d/30-postgresql-shm.conf"] ],
|
2013-02-07 22:20:10 +01:00
|
|
|
file => '/etc/sysctl.d/30-postgresql-shm.conf',
|
2013-02-07 22:43:54 +01:00
|
|
|
line => 'kernel.shmall = 1703936',
|
2013-02-07 22:20:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { "sysctl_p":
|
2013-02-07 23:55:40 +01:00
|
|
|
command => "/sbin/sysctl -p /etc/sysctl.d/30-postgresql-shm.conf",
|
2013-02-07 22:43:54 +01:00
|
|
|
require => [ Common::Line['shmmax'],
|
|
|
|
Common::Line['shmall'],
|
2013-02-07 22:20:10 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
exec { "disable_logrotate":
|
2013-02-07 23:55:40 +01:00
|
|
|
command => "/usr/bin/dpkg-divert --rename --divert /etc/logrotate.d/postgresql-common.disabled --add /etc/logrotate.d/postgresql-common",
|
2013-02-08 00:03:07 +01:00
|
|
|
creates => '/etc/logrotate.d/postgresql-common.disabled',
|
2013-02-07 22:20:10 +01:00
|
|
|
}
|
|
|
|
}
|