puppet: Pull postgres restart config into postgres_appdb_base.

While it is only currently used in the tuning configuration, it is a
property of the base configuration, and fits more clearly into the
case block there.
This commit is contained in:
Alex Vandiver 2020-06-11 19:49:28 -07:00 committed by Tim Abbott
parent 59e3c1f5e4
commit 2a7373b602
2 changed files with 3 additions and 6 deletions

View File

@ -12,6 +12,7 @@ class zulip::postgres_appdb_base {
$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::base::postgres_version} main restart"
}
'redhat': {
include zulip::yum_repository
@ -20,6 +21,7 @@ class zulip::postgres_appdb_base {
$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::base::postgres_version}"
}
default: {
fail('osfamily not supported')

View File

@ -7,11 +7,6 @@ class zulip::postgres_appdb_tuned {
'debian' => "/etc/postgresql/${zulip::base::postgres_version}/main/postgresql.conf",
'redhat' => "/var/lib/pgsql/${zulip::base::postgres_version}/data/postgresql.conf",
}
$postgres_restart = $::osfamily ? {
'debian' => "pg_ctlcluster ${zulip::base::postgres_version} main restart",
'redhat' => "systemctl restart postgresql-${zulip::base::postgres_version}",
}
$work_mem = $zulip::base::total_memory_mb / 512
$shared_buffers = $zulip::base::total_memory_mb / 8
$effective_cache_size = $zulip::base::total_memory_mb * 10 / 32
@ -38,7 +33,7 @@ class zulip::postgres_appdb_tuned {
content => template("zulip/postgresql/${zulip::base::postgres_version}/postgresql.conf.template.erb"),
}
exec { $postgres_restart:
exec { $zulip::postgres_appdb_base::postgres_restart:
require => Package[$zulip::postgres_appdb_base::postgresql],
refreshonly => true,
subscribe => [ File[$postgres_conf] ]