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: Make parent directories of postgresql.conf

Alex Vandiver8373f5f4b92b
diff --git a/puppet/zulip/manifests/postgres_appdb_base.pp b/puppet/zulip/manifests/postgres_appdb_base.pp
index 5186168dfa1..1c713e6e9d3 100644
--- a/puppet/zulip/manifests/postgres_appdb_base.pp
+++ b/puppet/zulip/manifests/postgres_appdb_base.pp
@@ -9,7 +9,11 @@ class zulip::postgres_appdb_base {
include zulip::apt_repository
$postgresql = "postgresql-${zulip::base::postgres_version}"
$postgres_sharedir = "/usr/share/postgresql/${zulip::base::postgres_version}"
- $postgres_confdir = "/etc/postgresql/${zulip::base::postgres_version}/main"
+ $postgres_confdirs = [
+ "/etc/postgresql/${zulip::base::postgres_version}",
+ "/etc/postgresql/${zulip::base::postgres_version}/main",
+ ]
+ $postgres_confdir = $postgres_confdirs[-1]
$postgres_datadir = "/var/lib/postgresql/${zulip::base::postgres_version}/main"
$tsearch_datadir = "${postgres_sharedir}/tsearch_data"
$pgroonga_setup_sql_path = "${postgres_sharedir}/pgroonga_setup.sql"
@@ -20,7 +24,11 @@ class zulip::postgres_appdb_base {
include zulip::yum_repository
$postgresql = "postgresql${zulip::base::postgres_version}"
$postgres_sharedir = "/usr/pgsql-${zulip::base::postgres_version}/share"
- $postgres_confdir = "/var/lib/pgsql/${zulip::base::postgres_version}/data"
+ $postgres_confdirs = [
+ "/var/lib/pgsql/${zulip::base::postgres_version}",
+ "/var/lib/pgsql/${zulip::base::postgres_version}/data",
+ ]
+ $postgres_confdir = $postgres_confdirs[-1]
$postgres_datadir = "/var/lib/pgsql/${zulip::base::postgres_version}/data"
$tsearch_datadir = "${postgres_sharedir}/tsearch_data/"
$pgroonga_setup_sql_path = "${postgres_sharedir}/pgroonga_setup.sql"
diff --git a/puppet/zulip/manifests/postgres_appdb_tuned.pp b/puppet/zulip/manifests/postgres_appdb_tuned.pp
index d85ae50cfab..86f7cd2c05e 100644
--- a/puppet/zulip/manifests/postgres_appdb_tuned.pp
+++ b/puppet/zulip/manifests/postgres_appdb_tuned.pp
@@ -17,6 +17,11 @@ class zulip::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:
+ ensure => directory,
+ owner => 'postgres',
+ group => 'postgres',
+ }
$postgres_conf_file = "${zulip::postgres_appdb_base::postgres_confdir}/postgresql.conf"
file { $postgres_conf_file: