Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Rename postgres_appdb to postgresql.

Alex Vandiver188af57296cf
diff --git a/docs/overview/architecture-overview.md b/docs/overview/architecture-overview.md
index 8c8f2cb76ea..0cda91dab59 100644
--- a/docs/overview/architecture-overview.md
+++ b/docs/overview/architecture-overview.md
@@ -266,7 +266,7 @@ This component is intended to install Nagios plugins intended to be run
on a Nagios server; most of the Zulip Nagios plugins are intended to be
run on the Zulip servers themselves, and are included with the relevant
component of the Zulip server (e.g.
-`puppet/zulip/manifests/postgres_backups.pp` installs a few under
+`puppet/zulip/manifests/postgresql_backups.pp` installs a few under
`/usr/lib/nagios/plugins/zulip_backups`).
## Glossary
diff --git a/docs/production/export-and-import.md b/docs/production/export-and-import.md
index 4e7ab4d7a48..69f3d68d152 100644
--- a/docs/production/export-and-import.md
+++ b/docs/production/export-and-import.md
@@ -162,7 +162,7 @@ data includes:
* The Postgres database. You can back it up like any Postgres
database. We have some example tooling for doing that incrementally
into S3 using [wal-g](https://github.com/wal-g/wal-g) in
-`puppet/zulip/manifests/postgres_backups.pp`.
+`puppet/zulip/manifests/postgresql_backups.pp`.
In short, this requires:
- Zulip 1.4 or newer release.
- An Amazon S3 bucket for storing the backups.
@@ -174,7 +174,7 @@ In short, this requires:
s3_backups_bucket = # name of S3 backup
```
- A cron job to run `/usr/local/bin/pg_backup_and_purge.py`. There's puppet
- config for this in `puppet/zulip/manifests/postgres_backups.pp`.
+ config for this in `puppet/zulip/manifests/postgresql_backups.pp`.
- Verification that backups are running via
`/usr/lib/nagios/plugins/zulip_postgres_backups/check_postgres_backup`.
diff --git a/puppet/zulip/manifests/app_frontend_base.pp b/puppet/zulip/manifests/app_frontend_base.pp
index 88768aa9176..b8118ba662d 100644
--- a/puppet/zulip/manifests/app_frontend_base.pp
+++ b/puppet/zulip/manifests/app_frontend_base.pp
@@ -11,7 +11,7 @@ class zulip::app_frontend_base {
# shell. This is not necessary on CentOS because the PostgreSQL
# package already includes the client. This may get us a more
# recent client than the database server is configured to be,
- # ($zulip::postgres_common::version), but they're compatible.
+ # ($zulip::postgresql_common::version), but they're compatible.
zulip::safepackage { 'postgresql-client': ensure => 'installed' }
}
# For Slack import
diff --git a/puppet/zulip/manifests/postgres_appdb_tuned.pp b/puppet/zulip/manifests/postgres_appdb_tuned.pp
index 6d6348f8b04..62356aa78af 100644
--- a/puppet/zulip/manifests/postgres_appdb_tuned.pp
+++ b/puppet/zulip/manifests/postgres_appdb_tuned.pp
@@ -1,4 +1,4 @@
-# @summary Temporary shim for postgres database server profile
+# @summary Temporary shim for postgresql database server profile
class zulip::postgres_appdb_tuned {
- include zulip::profile::postgres_appdb_tuned
+ include zulip::profile::postgresql
}
diff --git a/puppet/zulip/manifests/postgres_backups.pp b/puppet/zulip/manifests/postgresql_backups.pp
similarity index 90%
rename from puppet/zulip/manifests/postgres_backups.pp
rename to puppet/zulip/manifests/postgresql_backups.pp
index 59f21d3d02e..e82bb0ba1e5 100644
--- a/puppet/zulip/manifests/postgres_backups.pp
+++ b/puppet/zulip/manifests/postgresql_backups.pp
@@ -1,7 +1,7 @@
# @summary Use wal-g to take daily backups of PostgreSQL
#
-class zulip::postgres_backups {
- include zulip::postgres_common
+class zulip::postgresql_backups {
+ include zulip::postgresql_common
$wal_g_version = '0.2.15'
zulip::sha256_tarball_to { 'wal-g':
@@ -21,7 +21,7 @@ class zulip::postgres_backups {
group => 'postgres',
mode => '0750',
source => 'puppet:///modules/zulip/postgresql/env-wal-g',
- require => Package[$zulip::postgres_common::postgresql],
+ require => Package[$zulip::postgresql_common::postgresql],
}
file { '/usr/local/bin/pg_backup_and_purge':
@@ -33,7 +33,7 @@ class zulip::postgres_backups {
require => [
File['/usr/local/bin/env-wal-g'],
Package[
- $zulip::postgres_common::postgresql,
+ $zulip::postgresql_common::postgresql,
'python3-dateutil',
],
],
diff --git a/puppet/zulip/manifests/postgres_appdb_base.pp b/puppet/zulip/manifests/postgresql_base.pp
similarity index 77%
rename from puppet/zulip/manifests/postgres_appdb_base.pp
rename to puppet/zulip/manifests/postgresql_base.pp
index fd6d4e904fd..dfd5a465de1 100644
--- a/puppet/zulip/manifests/postgres_appdb_base.pp
+++ b/puppet/zulip/manifests/postgresql_base.pp
@@ -1,38 +1,38 @@
-# Minimal shared configuration needed to run a Zulip Postgres database.
-class zulip::postgres_appdb_base {
- include zulip::postgres_common
+# Minimal shared configuration needed to run a Zulip PostgreSQL database.
+class zulip::postgresql_base {
+ include zulip::postgresql_common
include zulip::process_fts_updates
case $::osfamily {
'debian': {
- $postgresql = "postgresql-${zulip::postgres_common::version}"
- $postgres_sharedir = "/usr/share/postgresql/${zulip::postgres_common::version}"
+ $postgresql = "postgresql-${zulip::postgresql_common::version}"
+ $postgres_sharedir = "/usr/share/postgresql/${zulip::postgresql_common::version}"
$postgres_confdirs = [
- "/etc/postgresql/${zulip::postgres_common::version}",
- "/etc/postgresql/${zulip::postgres_common::version}/main",
+ "/etc/postgresql/${zulip::postgresql_common::version}",
+ "/etc/postgresql/${zulip::postgresql_common::version}/main",
]
$postgres_confdir = $postgres_confdirs[-1]
- $postgres_datadir = "/var/lib/postgresql/${zulip::postgres_common::version}/main"
+ $postgres_datadir = "/var/lib/postgresql/${zulip::postgresql_common::version}/main"
$tsearch_datadir = "${postgres_sharedir}/tsearch_data"
$pgroonga_setup_sql_path = "${postgres_sharedir}/pgroonga_setup.sql"
$setup_system_deps = 'setup_apt_repo'
- $postgres_restart = "pg_ctlcluster ${zulip::postgres_common::version} main restart"
+ $postgres_restart = "pg_ctlcluster ${zulip::postgresql_common::version} main restart"
$postgres_dict_dict = '/var/cache/postgresql/dicts/en_us.dict'
$postgres_dict_affix = '/var/cache/postgresql/dicts/en_us.affix'
}
'redhat': {
- $postgresql = "postgresql${zulip::postgres_common::version}"
- $postgres_sharedir = "/usr/pgsql-${zulip::postgres_common::version}/share"
+ $postgresql = "postgresql${zulip::postgresql_common::version}"
+ $postgres_sharedir = "/usr/pgsql-${zulip::postgresql_common::version}/share"
$postgres_confdirs = [
- "/var/lib/pgsql/${zulip::postgres_common::version}",
- "/var/lib/pgsql/${zulip::postgres_common::version}/data",
+ "/var/lib/pgsql/${zulip::postgresql_common::version}",
+ "/var/lib/pgsql/${zulip::postgresql_common::version}/data",
]
$postgres_confdir = $postgres_confdirs[-1]
- $postgres_datadir = "/var/lib/pgsql/${zulip::postgres_common::version}/data"
+ $postgres_datadir = "/var/lib/pgsql/${zulip::postgresql_common::version}/data"
$tsearch_datadir = "${postgres_sharedir}/tsearch_data/"
$pgroonga_setup_sql_path = "${postgres_sharedir}/pgroonga_setup.sql"
$setup_system_deps = 'setup_yum_repo'
- $postgres_restart = "systemctl restart postgresql-${zulip::postgres_common::version}"
+ $postgres_restart = "systemctl restart postgresql-${zulip::postgresql_common::version}"
# TODO Since we can't find the Postgres dicts directory on CentOS yet, we
# link directly to the hunspell directory.
$postgres_dict_dict = '/usr/share/myspell/en_US.dic'
diff --git a/puppet/zulip/manifests/postgres_common.pp b/puppet/zulip/manifests/postgresql_common.pp
similarity index 98%
rename from puppet/zulip/manifests/postgres_common.pp
rename to puppet/zulip/manifests/postgresql_common.pp
index 20dae815fde..28371e183ef 100644
--- a/puppet/zulip/manifests/postgres_common.pp
+++ b/puppet/zulip/manifests/postgresql_common.pp
@@ -1,6 +1,5 @@
-class zulip::postgres_common {
+class zulip::postgresql_common {
$version = zulipconf('postgresql', 'version', undef)
-
case $::osfamily {
'debian': {
$postgresql = "postgresql-${version}"
diff --git a/puppet/zulip/manifests/profile/postgres_appdb_tuned.pp b/puppet/zulip/manifests/profile/postgresql.pp
similarity index 69%
rename from puppet/zulip/manifests/profile/postgres_appdb_tuned.pp
rename to puppet/zulip/manifests/profile/postgresql.pp
index 07f4d8dc479..05237260047 100644
--- a/puppet/zulip/manifests/profile/postgres_appdb_tuned.pp
+++ b/puppet/zulip/manifests/profile/postgresql.pp
@@ -1,8 +1,8 @@
# postgres_appdb_tuned extends postgres_appdb_base by automatically
# generating tuned database configuration.
-class zulip::profile::postgres_appdb_tuned {
+class zulip::profile::postgresql {
include zulip::profile::base
- include zulip::postgres_appdb_base
+ include zulip::postgresql_base
$work_mem = $zulip::common::total_memory_mb / 512
$shared_buffers = $zulip::common::total_memory_mb / 8
@@ -18,24 +18,24 @@ class zulip::profile::postgres_appdb_tuned {
$ssl_key_file = zulipconf('postgresql', 'ssl_key_file', undef)
$ssl_ca_file = zulipconf('postgresql', 'ssl_ca_file', undef)
- file { $zulip::postgres_appdb_base::postgres_confdirs:
+ file { $zulip::postgresql_base::postgres_confdirs:
ensure => directory,
owner => 'postgres',
group => 'postgres',
}
- $postgres_conf_file = "${zulip::postgres_appdb_base::postgres_confdir}/postgresql.conf"
+ $postgres_conf_file = "${zulip::postgresql_base::postgres_confdir}/postgresql.conf"
file { $postgres_conf_file:
ensure => file,
- require => Package[$zulip::postgres_appdb_base::postgresql],
+ require => Package[$zulip::postgresql_base::postgresql],
owner => 'postgres',
group => 'postgres',
mode => '0644',
- content => template("zulip/postgresql/${zulip::postgres_common::version}/postgresql.conf.template.erb"),
+ content => template("zulip/postgresql/${zulip::postgresql_common::version}/postgresql.conf.template.erb"),
}
- exec { $zulip::postgres_appdb_base::postgres_restart:
- require => Package[$zulip::postgres_appdb_base::postgresql],
+ exec { $zulip::postgresql_base::postgres_restart:
+ require => Package[$zulip::postgresql_base::postgresql],
refreshonly => true,
subscribe => [ File[$postgres_conf_file] ],
}
diff --git a/puppet/zulip/manifests/profile/standalone.pp b/puppet/zulip/manifests/profile/standalone.pp
index 2e41340974e..943f56106cf 100644
--- a/puppet/zulip/manifests/profile/standalone.pp
+++ b/puppet/zulip/manifests/profile/standalone.pp
@@ -9,7 +9,7 @@
class zulip::profile::standalone {
include zulip::profile::base
include zulip::profile::app_frontend
- include zulip::profile::postgres_appdb_tuned
+ include zulip::profile::postgresql
include zulip::profile::redis
include zulip::profile::memcached
include zulip::profile::rabbit
diff --git a/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb b/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb
index adf335f198b..236931bd178 100644
--- a/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb
+++ b/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid'
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid'
# (change requires restart)
@@ -473,7 +473,7 @@ log_line_prefix = '%m [%p] ' # special values:
# - Process Title -
-#cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
+#cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -676,10 +676,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
-maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
-effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
-work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
-shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
+maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
+effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
+work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
+shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>
diff --git a/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb
index 91d2bafbc25..e37c3775cb0 100644
--- a/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb
+++ b/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -473,7 +473,7 @@ log_timezone = 'UTC'
# - Process Title -
-cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
+cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -489,7 +489,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
-stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
+stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -676,10 +676,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
-maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
-effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
-work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
-shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
+maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
+effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
+work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
+shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>
diff --git a/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb
index 91d2bafbc25..e37c3775cb0 100644
--- a/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb
+++ b/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -473,7 +473,7 @@ log_timezone = 'UTC'
# - Process Title -
-cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
+cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -489,7 +489,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
-stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
+stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -676,10 +676,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
-maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
-effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
-work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
-shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
+maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
+effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
+work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
+shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>
diff --git a/puppet/zulip/templates/postgresql/12/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/12/postgresql.conf.template.erb
index fb345f8f120..17011bfd799 100644
--- a/puppet/zulip/templates/postgresql/12/postgresql.conf.template.erb
+++ b/puppet/zulip/templates/postgresql/12/postgresql.conf.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -542,7 +542,7 @@ log_timezone = 'UTC'
# PROCESS TITLE
#------------------------------------------------------------------------------
-cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
+cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -558,7 +558,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
-stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
+stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Monitoring -
@@ -770,10 +770,10 @@ vacuum_freeze_table_age = 1800000000
# Performance settings
max_connections = 1000
-maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
-effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
-work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
-shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
+maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
+effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
+work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
+shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>
diff --git a/puppet/zulip/templates/postgresql/9.3/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/9.3/postgresql.conf.template.erb
index 15c3e742c62..5067d3b6889 100644
--- a/puppet/zulip/templates/postgresql/9.3/postgresql.conf.template.erb
+++ b/puppet/zulip/templates/postgresql/9.3/postgresql.conf.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
diff --git a/puppet/zulip/templates/postgresql/9.5/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/9.5/postgresql.conf.template.erb
index ab0bf26a8c6..c1f5c2376d7 100644
--- a/puppet/zulip/templates/postgresql/9.5/postgresql.conf.template.erb
+++ b/puppet/zulip/templates/postgresql/9.5/postgresql.conf.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -462,7 +462,7 @@ log_timezone = 'localtime'
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
-stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
+stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -648,10 +648,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
-maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
-effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
-work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
-shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
+maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
+effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
+work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
+shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>
diff --git a/puppet/zulip/templates/postgresql/9.6/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/9.6/postgresql.conf.template.erb
index 017b753d2ef..a47fa2da201 100644
--- a/puppet/zulip/templates/postgresql/9.6/postgresql.conf.template.erb
+++ b/puppet/zulip/templates/postgresql/9.6/postgresql.conf.template.erb
@@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '<%= scope["zulip::postgres_appdb_base::postgres_datadir"] %>' # use data in another directory
+data_directory = '<%= scope["zulip::postgresql_base::postgres_datadir"] %>' # use data in another directory
# (change requires restart)
-hba_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
+hba_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '<%= scope["zulip::postgres_appdb_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
+ident_file = '<%= scope["zulip::postgresql_base::postgres_confdir"] %>/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pid' # write an extra PID file
# (change requires restart)
@@ -461,7 +461,7 @@ log_timezone = 'UTC'
# - Process Title -
-cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added to process titles if nonempty
+cluster_name = '<%= scope["zulip::postgresql_common::version"] %>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
@@ -477,7 +477,7 @@ cluster_name = '<%= scope["zulip::postgres_common::version"] %>/main' # added
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
-stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgres_common::version"] %>-main.pg_stat_tmp'
+stats_temp_directory = '/var/run/postgresql/<%= scope["zulip::postgresql_common::version"] %>-main.pg_stat_tmp'
# - Statistics Monitoring -
@@ -661,10 +661,10 @@ vacuum_freeze_min_age = 1000000000
vacuum_freeze_table_age = 1800000000
# Performance settings
-maintenance_work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::maintenance_work_mem"] %>MB
-effective_cache_size = <%= scope["zulip::profile::postgres_appdb_tuned::effective_cache_size"] %>MB
-work_mem = <%= scope["zulip::profile::postgres_appdb_tuned::work_mem"] %>MB
-shared_buffers = <%= scope["zulip::profile::postgres_appdb_tuned::shared_buffers"] %>MB
+maintenance_work_mem = <%= scope["zulip::profile::postgresql::maintenance_work_mem"] %>MB
+effective_cache_size = <%= scope["zulip::profile::postgresql::effective_cache_size"] %>MB
+work_mem = <%= scope["zulip::profile::postgresql::work_mem"] %>MB
+shared_buffers = <%= scope["zulip::profile::postgresql::shared_buffers"] %>MB
wal_buffers = 4MB
checkpoint_completion_target = 0.7
<% if @random_page_cost != '' -%>
diff --git a/puppet/zulip_ops/manifests/postgres_appdb.pp b/puppet/zulip_ops/manifests/postgres_appdb.pp
index 096fe8e6563..ee598c234ef 100644
--- a/puppet/zulip_ops/manifests/postgres_appdb.pp
+++ b/puppet/zulip_ops/manifests/postgres_appdb.pp
@@ -1,7 +1,7 @@
class zulip_ops::postgres_appdb {
include zulip_ops::base
- include zulip::profile::postgres_appdb_tuned
- include zulip::postgres_backups
+ include zulip::profile::postgresql
+ include zulip::postgresql_backups
$common_packages = ['xfsprogs']
package { $common_packages: ensure => 'installed' }
@@ -28,13 +28,13 @@ class zulip_ops::postgres_appdb {
}
exec { 'setup_disks':
command => '/root/setup_disks.sh',
- require => Package["postgresql-${zulip::postgres_common::version}", 'xfsprogs'],
+ require => Package["postgresql-${zulip::postgresql_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":
+ file { "${zulip::postgresql_base::postgres_confdir}/pg_hba.conf":
ensure => file,
- require => Package["postgresql-${zulip::postgres_common::version}"],
+ require => Package["postgresql-${zulip::postgresql_common::version}"],
owner => 'postgres',
group => 'postgres',
mode => '0640',
diff --git a/scripts/lib/install b/scripts/lib/install
index 6dfff800099..52a964533fe 100755
--- a/scripts/lib/install
+++ b/scripts/lib/install
@@ -233,7 +233,7 @@ EOF
fi
case ",$PUPPET_CLASSES," in
- *,zulip::profile::standalone,* | *,zulip::profile::postgres_appdb_tuned,*)
+ *,zulip::profile::standalone,* | *,zulip::profile::postgresql,*)
if [ "$package_system" = apt ]; then
# We're going to install Postgres from the Postgres apt
# repository; this may conflict with the existing Postgres.
@@ -408,7 +408,7 @@ EOF
# We only need the Postgres version setting on database hosts; but
# we don't know if this is a database host until we have the catalog summary.
- if ! has_class "zulip::postgres_common" || [ "$package_system" != apt ]; then
+ if ! has_class "zulip::postgresql_common" || [ "$package_system" != apt ]; then
crudini --del /etc/zulip/zulip.conf postgresql
fi
@@ -496,7 +496,7 @@ EOF
"$ZULIP_PATH"/scripts/setup/configure-rabbitmq
fi
-if has_class "zulip::postgres_common" && [ -z "$NO_INIT_DB" ]; then
+if has_class "zulip::postgresql_common" && [ -z "$NO_INIT_DB" ]; then
"$ZULIP_PATH"/scripts/setup/postgres-init-db
fi
diff --git a/scripts/setup/upgrade-postgres b/scripts/setup/upgrade-postgres
index d1fbd786b13..82b63cc7e66 100755
--- a/scripts/setup/upgrade-postgres
+++ b/scripts/setup/upgrade-postgres
@@ -31,7 +31,7 @@ fi
cp /etc/zulip/zulip.conf "$TEMP_CONF_DIR"
ZULIP_CONF="${TEMP_CONF_DIR}/zulip.conf"
crudini --set "$ZULIP_CONF" postgresql version "$UPGRADE_TO"
- crudini --set "$ZULIP_CONF" machine puppet_classes zulip::profile::base,zulip::postgres_appdb_base
+ crudini --set "$ZULIP_CONF" machine puppet_classes zulip::profile::base,zulip::postgresql_base
touch "/usr/share/postgresql/$UPGRADE_TO/pgroonga_setup.sql.applied"
"$ZULIP_PATH"/scripts/zulip-puppet-apply -f --config "$ZULIP_CONF"
diff --git a/tools/setup/install-aws-server b/tools/setup/install-aws-server
index 7ec854f6957..e7c693e1cbc 100755
--- a/tools/setup/install-aws-server
+++ b/tools/setup/install-aws-server
@@ -11,7 +11,7 @@ if [ -z "$SERVER" ] || [ -z "$ROLES" ]; then
echo
echo " * server is the local part of the hostname (e.g. postgres0)"
echo " * roles is a comma-separated list of Puppet rules to be passed to scripts/lib/install"
- echo " E.g. 'zulip::profile::postgres_appdb_tuned'"
+ echo " E.g. 'zulip::profile::postgresql'"
echo " * branch is used to override the default branch to install from."
echo
echo "Reads configuration from $HOME/.zulip-install-server.conf, which should look like:"