Skip to content

Commit 2257291

Browse files
added default setting for path
* postgresql::server::config_entry in postgresql::server::instance::config * easier path management in postgresql::server::config_entry
1 parent 6efaecd commit 2257291

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

manifests/server/config_entry.pp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@
99
Enum['present', 'absent'] $ensure = 'present',
1010
String[1] $key = $name,
1111
Optional[Variant[String[1], Numeric, Array[String[1]]]] $value = undef,
12-
Variant[Boolean, String[1]] $path = false
12+
Variant[Boolean, String[1]] $path = $postgresql::server::postgresql_conf_path
1313
) {
14-
$postgresql_conf_path = $postgresql::server::postgresql_conf_path
15-
16-
$target = $path ? {
17-
false => $postgresql_conf_path,
18-
default => $path,
19-
}
20-
2114
# Those are the variables that are marked as "(change requires restart)"
2215
# on postgresql.conf. Items are ordered as on postgresql.conf.
2316
#
@@ -91,7 +84,7 @@
9184

9285
postgresql_conf { $name:
9386
ensure => $ensure,
94-
target => $target,
87+
target => $path,
9588
name => $key,
9689
value => $value,
9790
require => Class['postgresql::server::initdb'],

manifests/server/instance/config.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@
148148
}
149149
}
150150
}
151+
# set default postgresql_conf_path here so the path is configurable in instances for
152+
# default values like port or listen_address
153+
Postgresql::Server::Config_entry {
154+
path => $postgresql_conf_path,
155+
}
151156

152157
if $manage_postgresql_conf_perms {
153158
file { $postgresql_conf_path:

0 commit comments

Comments
 (0)