Gehel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350413 )

Change subject: elasticsearch - cleanup hiera lookups with default "undef"
......................................................................

elasticsearch - cleanup hiera lookups with default "undef"

undef is problematic as an argument to puppet functions. In this case, we
can (and should) ensure that there is no default and that the proper hiera
variables are set.

This affects row awareness, which is unused for relforge and beta cluster. In
those cluster, awareness is now set to "none".

Change-Id: I2596e39f9dcb3996c0869d9d510d45d0a893b581
---
M hieradata/labs/deployment-prep/common.yaml
M hieradata/role/common/elasticsearch/relforge.yaml
M modules/profile/manifests/elasticsearch.pp
3 files changed, 10 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/13/350413/1

diff --git a/hieradata/labs/deployment-prep/common.yaml 
b/hieradata/labs/deployment-prep/common.yaml
index e469a3d..62d8b34 100644
--- a/hieradata/labs/deployment-prep/common.yaml
+++ b/hieradata/labs/deployment-prep/common.yaml
@@ -200,6 +200,9 @@
 "profile::elasticsearch::recover_after_nodes": 3
 "profile::elasticsearch::bulk_thread_pool_executors": 5
 "profile::elasticsearch::ferm_srange": ''
+"profile::elasticsearch::awareness_attributes": 'none'
+"profile::elasticsearch::rack": ''
+"profile::elasticsearch::row": ''
 "profile::elasticsearch::unicast_hosts":
     - deployment-elastic05.deployment-prep.eqiad.wmflabs
     - deployment-elastic06.deployment-prep.eqiad.wmflabs
diff --git a/hieradata/role/common/elasticsearch/relforge.yaml 
b/hieradata/role/common/elasticsearch/relforge.yaml
index 6672ad3..e5e5c5d 100644
--- a/hieradata/role/common/elasticsearch/relforge.yaml
+++ b/hieradata/role/common/elasticsearch/relforge.yaml
@@ -11,3 +11,7 @@
 
 # T130329
 profile::base::check_disk_options: -w 18% -c 15% -l -e -A -i 
"/srv/sd[a-b][1-3]" --exclude-type=tracefs
+
+profile::elasticsearch::awareness_attributes: 'none'
+profile::elasticsearch::rack: ''
+profile::elasticsearch::row: ''
diff --git a/modules/profile/manifests/elasticsearch.pp 
b/modules/profile/manifests/elasticsearch.pp
index fb92bce..ffe22d0 100644
--- a/modules/profile/manifests/elasticsearch.pp
+++ b/modules/profile/manifests/elasticsearch.pp
@@ -19,17 +19,13 @@
     $heap_memory = hiera('profile::elasticsearch::heap_memory')
     $expected_nodes = hiera('profile::elasticsearch::expected_nodes')
     $graylog_hosts = hiera('profile::elasticsearch::graylog_hosts')
-    $rack = hiera('profile::elasticsearch::rack', undef) # FIXME: default to 
undef does not work as expected
-    $row = hiera('profile::elasticsearch::row', undef)  # FIXME: default to 
undef does not work as expected
-    $awareness_attributes = 
hiera('profile::elasticsearch::awareness_attributes', undef)
+    $rack = hiera('profile::elasticsearch::rack')
+    $row = hiera('profile::elasticsearch::row')
+    $awareness_attributes = 
hiera('profile::elasticsearch::awareness_attributes')
     $bulk_thread_pool_executors = 
hiera('profile::elasticsearch::bulk_thread_pool_executors', 6)
     $certificate_name = hiera('profile::elasticsearch::certificate_name', 
$::fqdn)
     $recover_after_time = hiera('profile::elasticsearch::recover_after_time', 
'1s')
     $recover_after_nodes = 
hiera('profile::elasticsearch::recover_after_nodes', 1)
-
-    if ($::realm == 'production' and $row == undef) {
-        fail("Don't know row for ${::hostname} and row awareness should be 
turned on")
-    }
 
     $master_eligible = $::fqdn in $unicast_hosts
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2596e39f9dcb3996c0869d9d510d45d0a893b581
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <guillaume.leder...@wikimedia.org>

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

Reply via email to