Gehel has submitted this change and it was merged.

Change subject: Maps: Added list of cassandra servers
......................................................................


Maps: Added list of cassandra servers

Exposing variables with the list of cassandra servers allows to reduce
dulication of configuration.

Bug: T138092
Change-Id: I4482702c216a1b3f80c9b01f9a6eee1f3dbf5369
---
M modules/kartotherian/manifests/init.pp
M modules/kartotherian/templates/config.yaml.erb
M modules/tilerator/manifests/init.pp
M modules/tilerator/templates/config.yaml.erb
M modules/tilerator/templates/config_ui.yaml.erb
5 files changed, 44 insertions(+), 13 deletions(-)

Approvals:
  Gehel: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/kartotherian/manifests/init.pp 
b/modules/kartotherian/manifests/init.pp
index 2f00788..63cfdd8 100644
--- a/modules/kartotherian/manifests/init.pp
+++ b/modules/kartotherian/manifests/init.pp
@@ -20,11 +20,17 @@
 #   Contact groups for alerting.
 #   Default: 'admins'
 #
+# [*cassandra_servers*]
+#   List of cassandra server names used by Kartotherian
+#
 class kartotherian(
-    $conf_sources   = 'sources.prod.yaml',
-    $contact_groups = 'admins',
+    $conf_sources      = 'sources.prod.yaml',
+    $contact_groups    = 'admins',
+    $cassandra_servers = hiera('cassandra::seeds'),
 ) {
 
+    validate_array($cassandra_servers)
+
     $cassandra_kartotherian_user = 'kartotherian'
     $cassandra_kartotherian_pass = hiera('maps::cassandra_kartotherian_pass')
     $pgsql_kartotherian_user = 'kartotherian'
diff --git a/modules/kartotherian/templates/config.yaml.erb 
b/modules/kartotherian/templates/config.yaml.erb
index 1a537d7..95e5a1c 100644
--- a/modules/kartotherian/templates/config.yaml.erb
+++ b/modules/kartotherian/templates/config.yaml.erb
@@ -7,6 +7,11 @@
     cassandra-user: '<%= @cassandra_kartotherian_user %>'
     cassandra-pswd: '<%= @cassandra_kartotherian_pass %>'
 
+    cassandra-servers:
+<% @cassandra_servers.each do |cassandra_server| -%>
+        - <%= cassandra_server %>
+<% end %>
+
 sources: <%= @conf_sources %>
 
 # TODO: allowUserQueries should be removed when geoshapes are enabled in prod
diff --git a/modules/tilerator/manifests/init.pp 
b/modules/tilerator/manifests/init.pp
index 4fb9fb4..09a722d 100644
--- a/modules/tilerator/manifests/init.pp
+++ b/modules/tilerator/manifests/init.pp
@@ -20,10 +20,17 @@
 #   Contact groups for alerting.
 #   Default: 'admins'
 #
+# [*cassandra_servers*]
+#   List of cassandra server names used by Tilerator
+#
 class tilerator(
-    $conf_sources   = 'sources.prod.yaml',
-    $contact_groups = 'admins',
+    $conf_sources      = 'sources.prod.yaml',
+    $contact_groups    = 'admins',
+    $cassandra_servers = hiera('cassandra::seeds'),
 ) {
+
+    validate_array($cassandra_servers)
+
     include ::tilerator::ui
 
     $cassandra_tilerator_user = 'tilerator'
diff --git a/modules/tilerator/templates/config.yaml.erb 
b/modules/tilerator/templates/config.yaml.erb
index b2ca4f8..567ccab 100644
--- a/modules/tilerator/templates/config.yaml.erb
+++ b/modules/tilerator/templates/config.yaml.erb
@@ -1,12 +1,18 @@
-# Tilerator-specific settings
+# tilerator-specific settings
 
 redis: <%= @redis_server %>
 
 variables:
-  osmdb-user: '<%= @pgsql_tilerator_user %>'
-  osmdb-pswd: '<%= @pgsql_tilerator_pass %>'
-  cassandra-user: '<%= @cassandra_tilerator_user %>'
-  cassandra-pswd: '<%= @cassandra_tilerator_pass %>'
+    osmdb-user: '<%= @pgsql_tilerator_user %>'
+    osmdb-pswd: '<%= @pgsql_tilerator_pass %>'
+
+    cassandra-user: '<%= @cassandra_tilerator_user %>'
+    cassandra-pswd: '<%= @cassandra_tilerator_pass %>'
+
+    cassandra-servers:
+<% @cassandra_servers.each do |cassandra_server| -%>
+        - <%= cassandra_server %>
+<% end %>
 
 sources: <%= @conf_sources %>
 
diff --git a/modules/tilerator/templates/config_ui.yaml.erb 
b/modules/tilerator/templates/config_ui.yaml.erb
index 447e97d..5c47ac8 100644
--- a/modules/tilerator/templates/config_ui.yaml.erb
+++ b/modules/tilerator/templates/config_ui.yaml.erb
@@ -3,11 +3,18 @@
 redis: <%= @redis_server %>
 
 variables:
-  osmdb-user: '<%= @pgsql_tileratorui_user %>'
-  osmdb-pswd: '<%= @pgsql_tileratorui_pass %>'
-  cassandra-user: '<%= @cassandra_tileratorui_user %>'
-  cassandra-pswd: '<%= @cassandra_tileratorui_pass %>'
+    osmdb-user: '<%= @pgsql_tileratorui_user %>'
+    osmdb-pswd: '<%= @pgsql_tileratorui_pass %>'
+
+    cassandra-user: '<%= @cassandra_tileratorui_user %>'
+    cassandra-pswd: '<%= @cassandra_tileratorui_pass %>'
+
+    cassandra-servers:
+<% @cassandra_servers.each do |cassandra_server| -%>
+        - <%= cassandra_server %>
+<% end %>
 
 sources: <%= @conf_sources %>
+
 uiOnly: true
 allSourcesPublic: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4482702c216a1b3f80c9b01f9a6eee1f3dbf5369
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yurik <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to