zulip/servers/puppet/modules/humbug/manifests/postgres-common.pp

44 lines
1.4 KiB
Puppet

class humbug::postgres-common {
class { 'humbug::base': }
$postgres_packages = [ "postgresql-9.1", "pgtune", "python-boto",
"python-argparse", "python-gevent/squeeze-backports",
"lzop", "pv", "hunspell-en-us"]
package { $postgres_packages: ensure => "installed" }
exec {"pip_wal-e":
command => "/usr/bin/pip install git+git://github.com/zbenjamin/wal-e.git#egg=wal-e",
creates => "/usr/local/bin/wal-e",
require => Package['python-pip', 'python-boto', 'python-argparse',
'python-gevent/squeeze-backports', 'lzop', 'pv'],
}
file { "/usr/local/bin/env-wal-e":
ensure => file,
owner => "root",
group => "postgres",
mode => 750,
source => "puppet:///modules/humbug/postgresql/env-wal-e",
}
file { "/etc/postgresql/9.1/main/pg_hba.conf":
require => Package["postgresql-9.1"],
ensure => file,
owner => "postgres",
group => "postgres",
mode => 640,
source => "puppet:///modules/humbug/postgresql/pg_hba.conf",
}
exec { "sysctl_p":
command => "/sbin/sysctl -p /etc/sysctl.d/40-postgresql.conf",
subscribe => File['/etc/sysctl.d/40-postgresql.conf'],
refreshonly => true,
}
exec { "disable_logrotate":
command => "/usr/bin/dpkg-divert --rename --divert /etc/logrotate.d/postgresql-common.disabled --add /etc/logrotate.d/postgresql-common",
creates => '/etc/logrotate.d/postgresql-common.disabled',
}
}