Gehel has uploaded a new change for review.

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

Change subject: tilerator: deploy config with scap3
......................................................................

tilerator: deploy config with scap3

Bug: T150021
Change-Id: I0150abceb82c85a14b3fa62c6c7a3c30174e4def
---
M modules/tilerator/manifests/init.pp
M modules/tilerator/manifests/ui.pp
D modules/tilerator/templates/config.yaml.erb
D modules/tilerator/templates/config_ui.yaml.erb
4 files changed, 26 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/61/324761/1

diff --git a/modules/tilerator/manifests/init.pp 
b/modules/tilerator/manifests/init.pp
index 09a722d..6f5871d 100644
--- a/modules/tilerator/manifests/init.pp
+++ b/modules/tilerator/manifests/init.pp
@@ -31,7 +31,9 @@
 
     validate_array($cassandra_servers)
 
-    include ::tilerator::ui
+    class { '::tilerator::ui':
+        cassandra_servers => $cassandra_servers,
+    }
 
     $cassandra_tilerator_user = 'tilerator'
     $cassandra_tilerator_pass = hiera('maps::cassandra_tilerator_pass')
@@ -45,9 +47,19 @@
     # this port
     service::node { 'tilerator':
         port           => 6534,
-        config         => template('tilerator/config.yaml.erb'),
+        deployment_config => true,
         no_workers     => $::processorcount / 2,
         deployment     => 'scap3',
+        deployment_vars   => {
+            entrypoint         => '""',
+            all_sources_public => false,
+            conf_sources       => $conf_sources,
+            cassandra_user     => $cassandra_tilerator_user,
+            cassandra_password => $cassandra_tilerator_pass,
+            cassandra_servers  => $cassandra_servers,
+            osmdb_user         => $pgsql_tilerator_user,
+            osmdb_password     => $pgsql_tilerator_pass,
+        },
         contact_groups => $contact_groups,
     }
 
diff --git a/modules/tilerator/manifests/ui.pp 
b/modules/tilerator/manifests/ui.pp
index dbcbe48..e25a4b7 100644
--- a/modules/tilerator/manifests/ui.pp
+++ b/modules/tilerator/manifests/ui.pp
@@ -63,6 +63,7 @@
 #   directory in which osmosis keeps its state
 #
 class tilerator::ui(
+    $cassandra_servers,
     $port           = 6535,
     $conf_sources   = 'sources.prod.yaml',
     $contact_groups = 'admins',
@@ -84,10 +85,20 @@
 
     service::node { 'tileratorui':
         port           => $port,
-        config         => template('tilerator/config_ui.yaml.erb'),
+        deployment_config => true,
         no_workers     => 0, # 0 on purpose to only have one instance running
         repo           => 'tilerator/deploy',
         deployment     => 'scap3',
+        deployment_vars   => {
+            entrypoint         => '""',
+            all_sources_public => true,
+            conf_sources       => $conf_sources,
+            cassandra_user     => $cassandra_tileratorui_user,
+            cassandra_password => $cassandra_tileratorui_pass,
+            cassandra_servers  => $cassandra_servers,
+            osmdb_user         => $pgsql_tileratorui_user,
+            osmdb_password     => $pgsql_tileratorui_pass,
+        },
         contact_groups => $contact_groups,
     }
 
diff --git a/modules/tilerator/templates/config.yaml.erb 
b/modules/tilerator/templates/config.yaml.erb
deleted file mode 100644
index 567ccab..0000000
--- a/modules/tilerator/templates/config.yaml.erb
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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 %>'
-
-    cassandra-servers:
-<% @cassandra_servers.each do |cassandra_server| -%>
-        - <%= cassandra_server %>
-<% end %>
-
-sources: <%= @conf_sources %>
-
-# Do not expose admin UI or handle job handling web requests
-daemonOnly: true
diff --git a/modules/tilerator/templates/config_ui.yaml.erb 
b/modules/tilerator/templates/config_ui.yaml.erb
deleted file mode 100644
index 5c47ac8..0000000
--- a/modules/tilerator/templates/config_ui.yaml.erb
+++ /dev/null
@@ -1,20 +0,0 @@
-# tileratorui-specific settings
-
-redis: <%= @redis_server %>
-
-variables:
-    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/324761
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0150abceb82c85a14b3fa62c6c7a3c30174e4def
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