Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use variable for postgresql locale #422

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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