Gehel has uploaded a new change for review.

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

Change subject: Kartotherian: deploy application configuration with scap3
......................................................................

Kartotherian: deploy application configuration with scap3

Bug: T150021
Change-Id: Ic37af3ebbc22cff826e0e2c1bfbb44ff0914b3c0
---
A scap/config-files.yaml
M scap/scap.cfg
A scap/templates/config.yaml.j2
3 files changed, 78 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/maps/kartotherian/deploy 
refs/changes/73/324073/1

diff --git a/scap/config-files.yaml b/scap/config-files.yaml
new file mode 100644
index 0000000..779d42f
--- /dev/null
+++ b/scap/config-files.yaml
@@ -0,0 +1,5 @@
+----
+/etc/kartotherian/config.yaml:
+  template: config.yaml.j2
+  erb_syntax: True
+  remote_vars: /etc/kartotherian/config-vars.yaml
diff --git a/scap/scap.cfg b/scap/scap.cfg
index c80ee37..52a1302 100644
--- a/scap/scap.cfg
+++ b/scap/scap.cfg
@@ -10,6 +10,7 @@
 service_name: kartotherian
 service_port: 6533
 lock_file: /tmp/scap.kartotherian.lock
+config_deploy: True
 
 [wmnet]
 # git_server: mira.codfw.wmnet
diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2
new file mode 100644
index 0000000..0323265
--- /dev/null
+++ b/scap/templates/config.yaml.j2
@@ -0,0 +1,72 @@
+logging:
+  level: warn
+  name: <%= log_name %>
+  streams:
+    - host: <%= logstash_host %>
+      port: <%= logstash_port %>
+      type: gelf
+    - level: info
+      path: <%= log_file %>
+      type: file
+metrics:
+  host: <%= metrics_host %>
+  name: <%= metrics_name %>
+  port: <%= metrics_port %>
+  type: statsd
+num_workers: <%= num_workers %>
+services:
+  - conf:
+      allowedDomains:
+        https:
+          - mediawiki.org
+          - wikibooks.org
+          - wikidata.org
+          - wikimedia.org
+          - wikimediafoundation.org
+          - wikinews.org
+          - wikipedia.org
+          - wikiquote.org
+          - wikisource.org
+          - wikiversity.org
+          - wikivoyage.org
+          - wiktionary.org
+      cors: "*"
+      geoshapes:
+        allowUserQueries: true
+        database: gis
+        host: localhost
+        lineTable: planet_osm_line
+        password: <%= geoshapes_password %>
+        polygonTable: planet_osm_polygon
+        table: planet_osm_polygon
+        user: <%= geoshapes_user %>
+      mwapi_req:
+        body: "{{ default(request.query, {}) }}"
+        headers:
+          host: "{{request.params.domain}}"
+          user-agent: "{{user-agent}}"
+        method: post
+        uri: <%= mwapi %>
+      port: <%= port %>
+      proxy: <%= proxy %>
+      restbase_req:
+        body: "{{request.body}}"
+        headers: "{{request.headers}}"
+        method: "{{request.method}}"
+        query: "{{ default(request.query, {}) }}"
+        uri: "<%= restbase %>/{{domain}}/v1/{+path}"
+      sources: <%= conf_sources %>
+      variables:
+        cassandra-pswd: <%= cassandra_password %>
+        cassandra-servers:
+        <% for server in cassandra_servers -%>
+          - <%= server %>
+        <% endfor -%>
+        cassandra-user: <%= cassandra_user %>
+        osmdb-pswd: <%= osmdb_password %>
+        osmdb-user: <%= osmdb_user %>
+    entrypoint: <%= entrypoint %>
+    module: <%= module %>
+    name: <%= name %>
+worker_heap_limit_mb: <%= worker_heap_limit_mb %>
+worker_heartbeat_timeout: <%= worker_heartbeat_timeout %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic37af3ebbc22cff826e0e2c1bfbb44ff0914b3c0
Gerrit-PatchSet: 1
Gerrit-Project: maps/kartotherian/deploy
Gerrit-Branch: master
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