snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
This commit is contained in:
74
puppet/kandra/manifests/profile/postgresql.pp
Normal file
74
puppet/kandra/manifests/profile/postgresql.pp
Normal file
@@ -0,0 +1,74 @@
|
||||
class kandra::profile::postgresql inherits kandra::profile::base {
|
||||
include kandra::teleport::db
|
||||
include kandra::prometheus::postgresql
|
||||
|
||||
# We key off of `listen_addresses` being set to know if we should be starting PostgreSQL.
|
||||
$listen_addresses = zulipconf('postgresql', 'listen_addresses', undef)
|
||||
$is_stage1 = ($listen_addresses == undef)
|
||||
class { 'zulip::profile::postgresql':
|
||||
start => ! $is_stage1,
|
||||
}
|
||||
|
||||
package { ['xfsprogs', 'nvme-cli']: ensure => installed }
|
||||
|
||||
kandra::firewall_allow{ 'postgresql': }
|
||||
|
||||
zulip::sysctl { 'postgresql-swappiness':
|
||||
key => 'vm.swappiness',
|
||||
value => '0',
|
||||
}
|
||||
zulip::sysctl { 'postgresql-overcommit':
|
||||
key => 'vm.overcommit_memory',
|
||||
value => '2',
|
||||
}
|
||||
|
||||
file { '/root/setup_disks.sh':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0744',
|
||||
source => 'puppet:///modules/kandra/postgresql/setup_disks.sh',
|
||||
}
|
||||
exec { 'setup_disks':
|
||||
command => '/root/setup_disks.sh',
|
||||
# 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'],
|
||||
require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs', 'nvme-cli'],
|
||||
unless => 'test /var/lib/postgresql/ -ef /srv/data/postgresql/',
|
||||
}
|
||||
|
||||
# This is the second stage, after secrets are configured
|
||||
if (! $is_stage1) {
|
||||
$replication_primary = zulipconf('postgresql', 'replication_primary', undef)
|
||||
$replication_user = zulipconf('postgresql', 'replication_user', undef)
|
||||
if $replication_primary != undef and $replication_user != undef {
|
||||
file { '/root/setup_data.sh':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0744',
|
||||
source => 'puppet:///modules/kandra/postgresql/setup_data.sh',
|
||||
}
|
||||
exec { 'setup_data':
|
||||
command => '/root/setup_data.sh',
|
||||
require => [File['/usr/local/bin/env-wal-g'], Exec['setup_disks']],
|
||||
unless => "test -d /srv/data/postgresql/${zulip::postgresql_common::version}/main",
|
||||
timeout => 0,
|
||||
before => File["${zulip::postgresql_base::postgresql_datadir}/standby.signal"],
|
||||
notify => Service['postgresql'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file { "${zulip::postgresql_base::postgresql_confdir}/pg_hba.conf":
|
||||
ensure => file,
|
||||
require => Package["postgresql-${zulip::postgresql_common::version}"],
|
||||
notify => Service['postgresql'],
|
||||
owner => 'postgres',
|
||||
group => 'postgres',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/kandra/postgresql/pg_hba.conf',
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user