2016-10-17 04:05:49 +02:00
|
|
|
class zulip_ops::postgres_appdb {
|
2020-06-12 22:48:48 +02:00
|
|
|
include zulip_ops::base
|
2020-10-20 02:49:54 +02:00
|
|
|
include zulip::profile::postgres_appdb_tuned
|
2020-07-14 02:53:23 +02:00
|
|
|
include zulip::postgres_backups
|
2013-07-25 20:56:23 +02:00
|
|
|
|
2020-06-12 22:48:48 +02:00
|
|
|
$common_packages = ['xfsprogs']
|
|
|
|
package { $common_packages: ensure => 'installed' }
|
|
|
|
|
|
|
|
file { '/etc/sysctl.d/40-postgresql.conf':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/zulip_ops/postgresql/40-postgresql.conf',
|
|
|
|
}
|
|
|
|
exec { 'sysctl_p':
|
|
|
|
command => '/sbin/sysctl -p /etc/sysctl.d/40-postgresql.conf',
|
|
|
|
subscribe => File['/etc/sysctl.d/40-postgresql.conf'],
|
|
|
|
refreshonly => true,
|
|
|
|
}
|
|
|
|
|
|
|
|
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',
|
2020-10-20 09:34:57 +02:00
|
|
|
require => Package["postgresql-${zulip::postgres_common::version}", 'xfsprogs'],
|
2020-06-12 22:48:48 +02:00
|
|
|
unless => 'test $(readlink /var/lib/postgresql) = "/srv/postgresql/" -a -d /srv/postgresql',
|
|
|
|
}
|
|
|
|
|
2020-06-12 04:52:33 +02:00
|
|
|
file { "${zulip::postgres_appdb_base::postgres_confdir}/pg_hba.conf":
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => file,
|
2020-10-20 09:34:57 +02:00
|
|
|
require => Package["postgresql-${zulip::postgres_common::version}"],
|
2018-08-13 21:29:40 +02:00
|
|
|
owner => 'postgres',
|
|
|
|
group => 'postgres',
|
2018-08-13 21:20:34 +02:00
|
|
|
mode => '0640',
|
2018-08-13 21:29:40 +02:00
|
|
|
source => 'puppet:///modules/zulip_ops/postgresql/pg_hba.conf',
|
2013-07-25 20:56:23 +02:00
|
|
|
}
|
|
|
|
}
|