mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
This moves the puppet configuration closer to the "roles and profiles method"[1] which is suggested for organizing puppet classes. Notably, here it makes clear which classes are meant to be able to stand alone as deployments. Shims are left behind at the previous names, for compatibility with existing `zulip.conf` files when upgrading. [1] https://puppet.com/docs/pe/2019.8/the_roles_and_profiles_method
44 lines
1.4 KiB
Puppet
44 lines
1.4 KiB
Puppet
class zulip_ops::postgres_appdb {
|
|
include zulip_ops::base
|
|
include zulip::profile::postgres_appdb_tuned
|
|
include zulip::postgres_backups
|
|
|
|
$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',
|
|
require => Package["postgresql-${zulip::postgres_common::version}", 'xfsprogs'],
|
|
unless => 'test $(readlink /var/lib/postgresql) = "/srv/postgresql/" -a -d /srv/postgresql',
|
|
}
|
|
|
|
file { "${zulip::postgres_appdb_base::postgres_confdir}/pg_hba.conf":
|
|
ensure => file,
|
|
require => Package["postgresql-${zulip::postgres_common::version}"],
|
|
owner => 'postgres',
|
|
group => 'postgres',
|
|
mode => '0640',
|
|
source => 'puppet:///modules/zulip_ops/postgresql/pg_hba.conf',
|
|
}
|
|
}
|