Skip to content

Commit ead4013

Browse files
committed
Allow setting a hash of arbitrary postgresql settings
Prior to this commit, you could only manage the settings that were provided as parameters. After this commit, you can pass an arbitrary hash of other postgresql settings you'd like to manage and they will be managed as well.
1 parent ed0879d commit ead4013

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

manifests/postgresql_settings.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
String $maintenance_work_mem = "${::memory['system']['total_bytes'] / 1024 / 1024 / 16}MB",
88
String $work_mem = '8MB',
99
Integer $max_connections = 1000,
10+
Hash $arbitrary_postgresql_conf_settings = {},
1011
Float[0,1] $checkpoint_completion_target = 0.9,
1112
Float[0,1] $checkpoint_segments = 128,
1213
Boolean $manage_postgresql_service = true,
@@ -83,6 +84,14 @@
8384
value => "${checkpoint_segments}",
8485
}
8586

87+
if !empty($arbitrary_postgresql_conf_settings) {
88+
$arbitrary_postgresql_conf_settings.each | $key, $value | {
89+
postgresql_conf { $key :
90+
value => "${value}",
91+
}
92+
}
93+
}
94+
8695
if $manage_fact_values_autovacuum_cost_delay {
8796
postgresql_psql { 'Set autovacuum_cost_delay=0 for fact_values' :
8897
command => 'ALTER TABLE fact_values SET ( autovacuum_vacuum_cost_delay = 0 )',

0 commit comments

Comments
 (0)