Skip to content

Commit

Permalink
feat: use variable for postgresql locals.
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Godin <[email protected]>
  • Loading branch information
JGodin-C2C committed Dec 13, 2024
1 parent 566889c commit dd279e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#
# @param postgresql_ssl_ca_cert_path
# Path to the Postgresql SSL CA.
# @param postgresql_locale
# The locale to use for the database. Defaults to `C.UTF-8`.
#
# @param read_database_username
# The name of the read database user to connect as. Defaults to `puppetdb-read`. This
Expand Down Expand Up @@ -85,6 +87,7 @@
$postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path,
$postgresql_ssl_cert_path = $puppetdb::params::postgresql_ssl_cert_path,
$postgresql_ssl_ca_cert_path = $puppetdb::params::postgresql_ssl_ca_cert_path,
$postgresql_locale = $puppetdb::params::postgresql_locale,
$read_database_username = $puppetdb::params::read_database_username,
Variant[String[1], Sensitive[String[1]]] $read_database_password = $puppetdb::params::read_database_password,
$read_database_host = $puppetdb::params::read_database_host,
Expand Down Expand Up @@ -150,7 +153,7 @@
user => $database_username,
password => $database_password,
encoding => 'UTF8',
locale => 'en_US.UTF-8',
locale => $postgresql_locale,
grant => 'all',
port => $port,
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
$postgresql_ssl_key_path = "${postgresql_ssl_folder}/private_keys/${trusted['certname']}.pem"
$postgresql_ssl_ca_cert_path = "${postgresql_ssl_folder}/certs/ca.pem"

# Configuration of the locales
$postgresql_locale = 'C.UTF-8'

# certificates used for Jetty configuration
$ssl_set_cert_paths = false
$ssl_cert_path = "${ssl_dir}/public.pem"
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/classes/database/postgresql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
grant: 'all',
port: params[:database_port].to_i,
encoding: 'UTF8',
locale: 'en_US.UTF-8',
locale: params[:postgresql_locale],
)
}

Expand Down

0 comments on commit dd279e8

Please sign in to comment.