2020-10-20 04:45:50 +02:00
|
|
|
class zulip_ops::profile::postgresql {
|
2020-10-20 04:44:58 +02:00
|
|
|
include zulip_ops::profile::base
|
2020-10-20 04:10:17 +02:00
|
|
|
include zulip::profile::postgresql
|
2021-06-07 20:53:13 +02:00
|
|
|
include zulip_ops::teleport::db
|
2013-07-25 20:56:23 +02:00
|
|
|
|
2020-06-12 22:48:48 +02:00
|
|
|
$common_packages = ['xfsprogs']
|
|
|
|
package { $common_packages: ensure => 'installed' }
|
|
|
|
|
2021-05-25 04:12:28 +02:00
|
|
|
zulip_ops::firewall_allow{ 'postgresql': }
|
|
|
|
|
2020-06-12 22:48:48 +02:00
|
|
|
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 04:10:17 +02:00
|
|
|
require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs'],
|
2020-06-12 22:48:48 +02:00
|
|
|
unless => 'test $(readlink /var/lib/postgresql) = "/srv/postgresql/" -a -d /srv/postgresql',
|
|
|
|
}
|
|
|
|
|
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',
|
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
|
|
|
}
|
|
|
|
}
|