2024-02-06 21:40:19 +01:00
|
|
|
class kandra::profile::postgresql inherits kandra::profile::base {
|
2024-02-02 15:08:49 +01:00
|
|
|
|
2020-10-20 04:10:17 +02:00
|
|
|
include zulip::profile::postgresql
|
2024-02-06 21:40:19 +01:00
|
|
|
include kandra::teleport::db
|
|
|
|
include kandra::prometheus::postgresql
|
2013-07-25 20:56:23 +02:00
|
|
|
|
2020-06-12 22:48:48 +02:00
|
|
|
$common_packages = ['xfsprogs']
|
2022-03-16 01:23:53 +01:00
|
|
|
package { $common_packages: ensure => installed }
|
2020-06-12 22:48:48 +02:00
|
|
|
|
2024-02-06 21:40:19 +01:00
|
|
|
kandra::firewall_allow{ 'postgresql': }
|
2021-05-25 04:12:28 +02:00
|
|
|
|
2024-02-02 21:26:27 +01:00
|
|
|
zulip::sysctl { 'postgresql-swappiness':
|
|
|
|
key => 'vm.swappiness',
|
|
|
|
value => '0',
|
|
|
|
}
|
|
|
|
zulip::sysctl { 'postgresql-overcommit':
|
|
|
|
key => 'vm.overcommit_memory',
|
|
|
|
value => '2',
|
2020-06-12 22:48:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/root/setup_disks.sh':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0744',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/postgresql/setup_disks.sh',
|
2020-06-12 22:48:48 +02:00
|
|
|
}
|
|
|
|
exec { 'setup_disks':
|
|
|
|
command => '/root/setup_disks.sh',
|
2020-10-20 04:10:17 +02:00
|
|
|
require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs'],
|
2021-12-28 20:57:15 +01:00
|
|
|
unless => 'test /var/lib/postgresql/ -ef /srv/postgresql/',
|
2020-06-12 22:48:48 +02:00
|
|
|
}
|
|
|
|
|
2020-10-26 21:56:58 +01:00
|
|
|
file { "${zulip::postgresql_base::postgresql_confdir}/pg_hba.conf":
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => file,
|
2020-10-20 04:10:17 +02:00
|
|
|
require => Package["postgresql-${zulip::postgresql_common::version}"],
|
2018-08-13 21:29:40 +02:00
|
|
|
owner => 'postgres',
|
|
|
|
group => 'postgres',
|
2018-08-13 21:20:34 +02:00
|
|
|
mode => '0640',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/postgresql/pg_hba.conf',
|
2013-07-25 20:56:23 +02:00
|
|
|
}
|
|
|
|
}
|