Gehel has submitted this change and it was merged.

Change subject: postgresql - ensure that correct locale is used to initialise 
postgres cluster
......................................................................


postgresql - ensure that correct locale is used to initialise postgres cluster

Setting locale explicitely ensures that the cluster is created with the
same locale, collation and encoding whether the $LANG and $LC_* environment
variables are set or not.

Change-Id: I41f69d7ddf6e91dbb9750ede681f46b3d5fd20b8
---
M modules/postgresql/manifests/master.pp
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Gehel: Looks good to me, approved
  Yurik: Looks good to me, but someone else must approve
  Alexandros Kosiaris: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/postgresql/manifests/master.pp 
b/modules/postgresql/manifests/master.pp
index 0cdcdf8..6b3b554 100644
--- a/modules/postgresql/manifests/master.pp
+++ b/modules/postgresql/manifests/master.pp
@@ -21,6 +21,10 @@
 #       See $postgresql::server::root_dir
 #   use_ssl
 #       Enable ssl
+#   locale
+#       Locale used to initialise posgresql cluster.
+#       Setting the locale ensure that locale and encodings will be the same
+#       whether $LANG and $LC_* are set or not.
 #
 # Actions:
 #  Install/configure postgresql as a master. Also create replication users
@@ -44,6 +48,7 @@
     $wal_keep_segments=128,
     $root_dir='/var/lib/postgresql',
     $use_ssl=false,
+    $locale='en_US.UTF-8',
 ) {
 
     $data_dir = "${root_dir}/${pgversion}/main"
@@ -67,7 +72,7 @@
 
     if $ensure == 'present' {
         exec { 'pg-initdb':
-            command => "/usr/lib/postgresql/${pgversion}/bin/initdb -D 
${data_dir}",
+            command => "/usr/lib/postgresql/${pgversion}/bin/initdb --locale 
${locale} -D ${data_dir}",
             user    => 'postgres',
             unless  => "/usr/bin/test -f ${data_dir}/PG_VERSION",
             require => Class['postgresql::server'],

-- 
To view, visit https://gerrit.wikimedia.org/r/316342
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I41f69d7ddf6e91dbb9750ede681f46b3d5fd20b8
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: Volans <rcocci...@wikimedia.org>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to