Skip to content

Commit dd279e8

Browse files
committed
feat: use variable for postgresql locals.
Signed-off-by: Julien Godin <julien.godin@camptocamp.com>
1 parent 566889c commit dd279e8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

manifests/database/postgresql.pp

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
#
5050
# @param postgresql_ssl_ca_cert_path
5151
# Path to the Postgresql SSL CA.
52+
# @param postgresql_locale
53+
# The locale to use for the database. Defaults to `C.UTF-8`.
5254
#
5355
# @param read_database_username
5456
# The name of the read database user to connect as. Defaults to `puppetdb-read`. This
@@ -85,6 +87,7 @@
8587
$postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path,
8688
$postgresql_ssl_cert_path = $puppetdb::params::postgresql_ssl_cert_path,
8789
$postgresql_ssl_ca_cert_path = $puppetdb::params::postgresql_ssl_ca_cert_path,
90+
$postgresql_locale = $puppetdb::params::postgresql_locale,
8891
$read_database_username = $puppetdb::params::read_database_username,
8992
Variant[String[1], Sensitive[String[1]]] $read_database_password = $puppetdb::params::read_database_password,
9093
$read_database_host = $puppetdb::params::read_database_host,
@@ -150,7 +153,7 @@
150153
user => $database_username,
151154
password => $database_password,
152155
encoding => 'UTF8',
153-
locale => 'en_US.UTF-8',
156+
locale => $postgresql_locale,
154157
grant => 'all',
155158
port => $port,
156159
}

manifests/params.pp

+3
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@
196196
$postgresql_ssl_key_path = "${postgresql_ssl_folder}/private_keys/${trusted['certname']}.pem"
197197
$postgresql_ssl_ca_cert_path = "${postgresql_ssl_folder}/certs/ca.pem"
198198

199+
# Configuration of the locales
200+
$postgresql_locale = 'C.UTF-8'
201+
199202
# certificates used for Jetty configuration
200203
$ssl_set_cert_paths = false
201204
$ssl_cert_path = "${ssl_dir}/public.pem"

spec/unit/classes/database/postgresql_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
grant: 'all',
6464
port: params[:database_port].to_i,
6565
encoding: 'UTF8',
66-
locale: 'en_US.UTF-8',
66+
locale: params[:postgresql_locale],
6767
)
6868
}
6969

0 commit comments

Comments
 (0)