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: Pull postgres restart config into postgres_appdb_base.

Alex Vandiver2a7373b60275
diff --git a/puppet/zulip/manifests/postgres_appdb_base.pp b/puppet/zulip/manifests/postgres_appdb_base.pp
index 69ef1828bef..2eb138c2167 100644
--- a/puppet/zulip/manifests/postgres_appdb_base.pp
+++ b/puppet/zulip/manifests/postgres_appdb_base.pp
@@ -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')
diff --git a/puppet/zulip/manifests/postgres_appdb_tuned.pp b/puppet/zulip/manifests/postgres_appdb_tuned.pp
index de5cf72100b..d2cb7216e49 100644
--- a/puppet/zulip/manifests/postgres_appdb_tuned.pp
+++ b/puppet/zulip/manifests/postgres_appdb_tuned.pp
@@ -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] ]