Skip to content

Commit e2e82d3

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 8474354 commit e2e82d3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

manifests/server/config_entry.pp

+2-9
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

+5
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@
138138
}
139139
}
140140
}
141+
# set default postgresql_conf_path here so the path is configurable in instances for
142+
# default values like port or listen_address
143+
Postgresql::Server::Config_entry {
144+
path => $postgresql_conf_path,
145+
}
141146

142147
if $manage_postgresql_conf_perms {
143148
file { $postgresql_conf_path:

0 commit comments

Comments
 (0)