From 2d85b67360797b2f11c3642c74551e0625846f4e Mon Sep 17 00:00:00 2001 From: Tim Bishop Date: Fri, 26 Sep 2014 12:43:21 +0100 Subject: [PATCH] Ensure that data_directory is set in the config. If the user specifies an alternate data directory by using the $datadir variable, it is respected by the initdb class but isn't set in the configuration before starting the server. This change fixes that. --- manifests/server/config.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifests/server/config.pp b/manifests/server/config.pp index 2845cab377..4c82e204a5 100644 --- a/manifests/server/config.pp +++ b/manifests/server/config.pp @@ -15,6 +15,7 @@ $version = $postgresql::server::_version $manage_pg_hba_conf = $postgresql::server::manage_pg_hba_conf $manage_pg_ident_conf = $postgresql::server::manage_pg_ident_conf + $datadir = $postgresql::server::datadir if ($manage_pg_hba_conf == true) { # Prepare the main pg_hba file @@ -101,6 +102,10 @@ value => $port, } + postgresql::server::config_entry { 'data_directory': + value => $datadir, + } + # RedHat-based systems hardcode some PG* variables in the init script, and need to be overriden # in /etc/sysconfig/pgsql/postgresql. Create a blank file so we can manage it with augeas later. if ($::osfamily == 'RedHat') and ($::operatingsystemrelease !~ /^7/) and ($::operatingsystem != 'Fedora') {