From 4c460728224e76180eb7142d76d3286099913387 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 21 Feb 2024 15:05:10 +0100 Subject: [PATCH] don't set data_directory in config when we configure it via env Fixes: #1576 --- manifests/server/instance/config.pp | 8 +++++--- spec/defines/server_instance_spec.rb | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/server/instance/config.pp b/manifests/server/instance/config.pp index d596d0846b..c631a43a3e 100644 --- a/manifests/server/instance/config.pp +++ b/manifests/server/instance/config.pp @@ -219,9 +219,11 @@ } } - postgresql::server::config_entry { "data_directory_for_instance_${name}": - key => 'data_directory', - value => $datadir, + unless $facts['service_provider'] == 'systemd' and $facts['os']['family'] in ['RedHat', 'Gentoo'] { + postgresql::server::config_entry { "data_directory_for_instance_${name}": + key => 'data_directory', + value => $datadir, + } } if $timezone { postgresql::server::config_entry { "timezone_for_instance_${name}": diff --git a/spec/defines/server_instance_spec.rb b/spec/defines/server_instance_spec.rb index 89eadb06c8..cd904bb9e1 100644 --- a/spec/defines/server_instance_spec.rb +++ b/spec/defines/server_instance_spec.rb @@ -123,7 +123,6 @@ class { 'postgresql::server': it { is_expected.to contain_postgresql_conn_validator('validate_service_is_running_instance_test1') } it { is_expected.to contain_postgresql_conf('port_for_instance_test1') } it { is_expected.to contain_postgresql_conf('log_statement_stats_test1') } - it { is_expected.to contain_postgresql_conf('data_directory_for_instance_test1') } it { is_expected.to contain_postgresql_conf('autovacuum_vacuum_scale_factor_test1') } it { is_expected.to contain_postgresql_conf('authentication_timeout_test1') } it { is_expected.to contain_postgresql__server__role('app_test1') } @@ -159,7 +158,6 @@ class { 'postgresql::server': it { is_expected.to contain_file('/opt/pgsql') } it { is_expected.to contain_postgresql__server__config_entry('authentication_timeout_test1') } it { is_expected.to contain_postgresql__server__config_entry('autovacuum_vacuum_scale_factor_test1') } - it { is_expected.to contain_postgresql__server__config_entry('data_directory_for_instance_test1') } it { is_expected.to contain_postgresql__server__config_entry('log_statement_stats_test1') } it { is_expected.to contain_postgresql__server__config_entry('password_encryption_for_instance_test1') } it { is_expected.to contain_postgresql__server__config_entry('port_for_instance_test1') }