zulip/puppet/zulip_ops/manifests/profile/postgresql.pp

43 lines
1.2 KiB
ObjectPascal
Raw Normal View History

class zulip_ops::profile::postgresql inherits zulip_ops::profile::base {
include zulip::profile::postgresql
include zulip_ops::teleport::db
2023-03-30 19:50:28 +02:00
include zulip_ops::prometheus::postgresql
$common_packages = ['xfsprogs']
package { $common_packages: ensure => installed }
zulip_ops::firewall_allow{ 'postgresql': }
zulip::sysctl { 'postgresql-swappiness':
key => 'vm.swappiness',
value => '0',
}
zulip::sysctl { 'postgresql-overcommit':
key => 'vm.overcommit_memory',
value => '2',
}
file { '/root/setup_disks.sh':
ensure => file,
owner => 'root',
group => 'root',
mode => '0744',
source => 'puppet:///modules/zulip_ops/postgresql/setup_disks.sh',
}
exec { 'setup_disks':
command => '/root/setup_disks.sh',
require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs'],
unless => 'test /var/lib/postgresql/ -ef /srv/postgresql/',
}
file { "${zulip::postgresql_base::postgresql_confdir}/pg_hba.conf":
ensure => file,
require => Package["postgresql-${zulip::postgresql_common::version}"],
owner => 'postgres',
group => 'postgres',
mode => '0640',
source => 'puppet:///modules/zulip_ops/postgresql/pg_hba.conf',
}
}