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
|
|
|
|
2024-03-29 04:39:44 +01:00
|
|
|
package { ['xfsprogs', 'nvme-cli']: 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',
|
2024-03-29 04:53:12 +01:00
|
|
|
# We need to not have started installing the non-AWS kernel, so
|
|
|
|
# the xfs module gets installed for the running kernel, and we can
|
|
|
|
# mount it.
|
|
|
|
before => Package['linux-image-virtual'],
|
2024-03-29 04:39:44 +01:00
|
|
|
require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs', 'nvme-cli'],
|
2024-03-29 04:44:18 +01:00
|
|
|
unless => 'test /var/lib/postgresql/ -ef /srv/data/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}"],
|
2024-04-17 21:52:21 +02:00
|
|
|
notify => Exec[$zulip::postgresql_base::postgresql_restart],
|
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
|
|
|
}
|
|
|
|
}
|