Gehel has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316342

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/42/316342/1

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: newchange
Gerrit-Change-Id: I41f69d7ddf6e91dbb9750ede681f46b3d5fd20b8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <gleder...@wikimedia.org>

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

Reply via email to