Giuseppe Lavagetto has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352851 )

Change subject: restbase: migration to role/profile for the dev cluster
......................................................................

restbase: migration to role/profile for the dev cluster

* Created profiles for restbase/cassandra, loosely couple to the old
  corresponding roles
* Unified the logic for cassandra::seeds and cassandra::instances by
  using a shared data structure and a template to modify items
* Created a role for restbase::dev_cluster and defined its hiera
  variables
* Consequently dropped all of the data in regex.yaml and in
  hosts/* (apart from rack positioning)
* LVS is still included but might probably be removed from here

Change-Id: I817204597d421c3bc52a7778e992bd0c1dc473c7
---
M hieradata/hosts/restbase-dev1001.yaml
M hieradata/hosts/restbase-dev1002.yaml
M hieradata/hosts/restbase-dev1003.yaml
M hieradata/regex.yaml
A hieradata/role/common/restbase/dev_cluster.yaml
M manifests/site.pp
A modules/profile/manifests/cassandra.pp
A modules/profile/manifests/restbase.pp
A modules/profile/templates/cassandra/seeds.erb
A modules/role/manifests/restbase/dev_cluster.pp
10 files changed, 431 insertions(+), 111 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/51/352851/1

diff --git a/hieradata/hosts/restbase-dev1001.yaml 
b/hieradata/hosts/restbase-dev1001.yaml
index 482406d..77d8681 100644
--- a/hieradata/hosts/restbase-dev1001.yaml
+++ b/hieradata/hosts/restbase-dev1001.yaml
@@ -1,14 +1 @@
 cassandra::rack: 'rack1'
-cassandra::instances:
-  a:
-    jmx_port: 7189
-    listen_address: 10.64.0.36
-    rpc_address: 10.64.0.36
-    rpc_interface: eth0
-  b:
-    jmx_port: 7190
-    listen_address: 10.64.0.37
-    rpc_address: 10.64.0.37
-    rpc_interface: eth0
-
-do_paging: false
diff --git a/hieradata/hosts/restbase-dev1002.yaml 
b/hieradata/hosts/restbase-dev1002.yaml
index 8ddbeb6..cf9532d 100644
--- a/hieradata/hosts/restbase-dev1002.yaml
+++ b/hieradata/hosts/restbase-dev1002.yaml
@@ -1,14 +1 @@
 cassandra::rack: 'rack2'
-cassandra::instances:
-  a:
-    jmx_port: 7189
-    listen_address: 10.64.32.159
-    rpc_address: 10.64.32.159
-    rpc_interface: eth0
-  b:
-    jmx_port: 7190
-    listen_address: 10.64.32.160
-    rpc_address: 10.64.32.160
-    rpc_interface: eth0
-
-do_paging: false
diff --git a/hieradata/hosts/restbase-dev1003.yaml 
b/hieradata/hosts/restbase-dev1003.yaml
index e674e0b..a7de19d 100644
--- a/hieradata/hosts/restbase-dev1003.yaml
+++ b/hieradata/hosts/restbase-dev1003.yaml
@@ -1,14 +1 @@
 cassandra::rack: 'rack3'
-cassandra::instances:
-  a:
-    jmx_port: 7189
-    listen_address: 10.64.48.117
-    rpc_address: 10.64.48.117
-    rpc_interface: eth0
-  b:
-    jmx_port: 7190
-    listen_address: 10.64.48.118
-    rpc_address: 10.64.48.118
-    rpc_interface: eth0
-
-do_paging: false
diff --git a/hieradata/regex.yaml b/hieradata/regex.yaml
index f11bd0d..3bf114d 100644
--- a/hieradata/regex.yaml
+++ b/hieradata/regex.yaml
@@ -294,77 +294,6 @@
   restbase::cassandra_tls:
     ca: /dev/null
 
-restbase_dev_eqiad:
-  __regex: !ruby/regexp /^restbase-dev100[1-3]\.eqiad\.wmnet$/
-  cluster: restbase_dev
-  cassandra::seeds:
-      - restbase-dev1001.eqiad.wmnet
-      - restbase-dev1001-a.eqiad.wmnet
-      - restbase-dev1001-b.eqiad.wmnet
-      - restbase-dev1002.eqiad.wmnet
-      - restbase-dev1002-a.eqiad.wmnet
-      - restbase-dev1002-b.eqiad.wmnet
-      - restbase-dev1003.eqiad.wmnet
-      - restbase-dev1003-a.eqiad.wmnet
-      - restbase-dev1003-b.eqiad.wmnet
-  restbase::seeds:
-      - restbase-dev1001-a.eqiad.wmnet
-      - restbase-dev1001-b.eqiad.wmnet
-      - restbase-dev1002-a.eqiad.wmnet
-      - restbase-dev1002-b.eqiad.wmnet
-      - restbase-dev1003-a.eqiad.wmnet
-      - restbase-dev1003-b.eqiad.wmnet
-  restbase::hosts:
-    - restbase-dev1001.eqiad.wmnet
-    - restbase-dev1002.eqiad.wmnet
-    - restbase-dev1003.eqiad.wmnet
-  restbase::cassandra_datacenters:
-      - eqiad
-  restbase::statsd_prefix: restbase-dev
-  cassandra::max_heap_size: 12g
-  cassandra::cluster_name: services-dev
-  cassandra::tls_cluster_name: services-dev
-  cassandra::internode_encryption: dc
-  cassandra::application_username: restb
-  cassandra::application_password: "%{passwords::cassandra::restbase}"
-  restbase::cassandra_user: restb
-  restbase::cassandra_password: "%{passwords::cassandra::restbase}"
-  cassandra::metrics::whitelist:
-    - .*\.metrics\.Table\.local_group_.*\.meta\.CoordinatorReadLatency\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.CoordinatorScanLatency\..*$
-    - 
.*\.metrics\.Table\.local_group_.*\.meta\.EstimatedColumnCountHistogram\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.EstimatedRowCount\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.EstimatedRowSizeHistogram\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.LiveDiskSpaceUsed\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.LiveSSTableCount\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.LiveScannedHistogram\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.MaxRowSize\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.MeanRowSize\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.MinRowSize\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.PendingCompactions\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.PendingFlushes\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.RangeLatency\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.ReadLatency\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.SSTablesPerReadHistogram\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.TombstoneScannedHistogram\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.TotalDiskSpaceUsed\..*$
-    - .*\.metrics\.Table\.local_group_.*\.meta\.WriteLatency\..*$
-  cassandra::metrics::blacklist:
-      - .*\.15MinuteRate$
-      - .*\.5MinuteRate$
-      - .*\.98percentile$
-      - .*\.999percentile$
-      - .*\.max$
-      - .*\.mean$
-      - .*\.meanRate$
-      - .*\.min$
-      - .*\.stddev$
-      - .*\.metrics\.Keyspace\..*$
-      - .*\.metrics\.Client\..*$
-      - .*\.metrics\.ColumnFamily\..*$
-  restbase::logging_name: restbase-dev
-  cassandra::start_rpc: 'true'
-  cassandra::target_version: '3.7'
 
 swift_be_codfw_dell:
   __regex: !ruby/regexp /^ms-be20(0[0-9]|1[0-5])\.codfw\.wmnet$/
diff --git a/hieradata/role/common/restbase/dev_cluster.yaml 
b/hieradata/role/common/restbase/dev_cluster.yaml
new file mode 100644
index 0000000..0c5108c
--- /dev/null
+++ b/hieradata/role/common/restbase/dev_cluster.yaml
@@ -0,0 +1,151 @@
+# We don't want paging
+do_paging: false
+
+#
+# RESTBase
+#
+cluster: restbase_dev
+profile::restbase::cassandra_local_dc: "%{::site}"
+profile::restbase::logging_label: restbase-dev
+profile::restbase::cassandra_datacenters:
+    - "eqiad"
+profile::restbase::parsoid_uri: "http://parsoid.discovery.wmnet:8000";
+profile::restbase::graphoid_uri: "http://graphoid.discovery.wmnet:19000";
+profile::restbase::mobileapps_uri: "http://mobileapps.discovery.wmnet:8888";
+profile::restbase::mathoid_uri: "http://mathoid.discovery.wmnet:10042";
+profile::restbase::aqs_uri: 
"http://aqs.svc.%{::aqs_site}.wmnet:7232/analytics.wikimedia.org/v1";
+profile::restbase::pdfrender_uri: "http://pdfrender.discovery.wmnet:5252";
+profile::restbase::citoid_uri: "http://citoid.discovery.wmnet:1970";
+profile::restbase::trendingedits_uri: 
"http://trendingedits.svc.%{::site}.wmnet:6699";
+profile::restbase::cassandra_user: restb
+profile::restbase::cassandra_password: "%{passwords::cassandra::restbase}"
+profile::restbase::monitoring::monitor_domain: en.wikipedia.org
+profile::restbase::cassandra_tls:
+  ca: /dev/null
+# TODO: get this from cassandra's instances?
+profile::restbase::seeds:
+      - restbase-dev1001-a.eqiad.wmnet
+      - restbase-dev1001-b.eqiad.wmnet
+      - restbase-dev1002-a.eqiad.wmnet
+      - restbase-dev1002-b.eqiad.wmnet
+      - restbase-dev1003-a.eqiad.wmnet
+      - restbase-dev1003-b.eqiad.wmnet
+profile::restbase::hosts:
+  - restbase-dev1001.eqiad.wmnet
+  - restbase-dev1002.eqiad.wmnet
+  - restbase-dev1003.eqiad.wmnet
+
+
+#
+# Cassandra
+#
+## Metrics
+graphite_host: 'graphite1003.eqiad.wmnet'
+
+profile::cassandra::metrics_whitelist:
+    - .*\.metrics\.Table\.local_group_.*\.meta\.CoordinatorReadLatency\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.CoordinatorScanLatency\..*$
+    - 
.*\.metrics\.Table\.local_group_.*\.meta\.EstimatedColumnCountHistogram\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.EstimatedRowCount\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.EstimatedRowSizeHistogram\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.LiveDiskSpaceUsed\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.LiveSSTableCount\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.LiveScannedHistogram\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.MaxRowSize\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.MeanRowSize\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.MinRowSize\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.PendingCompactions\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.PendingFlushes\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.RangeLatency\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.ReadLatency\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.SSTablesPerReadHistogram\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.TombstoneScannedHistogram\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.TotalDiskSpaceUsed\..*$
+    - .*\.metrics\.Table\.local_group_.*\.meta\.WriteLatency\..*$
+profile::cassandra::metrics_blacklist:
+      - .*\.15MinuteRate$
+      - .*\.5MinuteRate$
+      - .*\.98percentile$
+      - .*\.999percentile$
+      - .*\.max$
+      - .*\.mean$
+      - .*\.meanRate$
+      - .*\.min$
+      - .*\.stddev$
+      - .*\.metrics\.Keyspace\..*$
+      - .*\.metrics\.Client\..*$
+      - .*\.metrics\.ColumnFamily\..*$
+
+## Instances
+profile::cassandra::instances:
+  "restbase-dev1001.eqiad.wmnet":
+    a:
+      jmx_port: 7189
+      listen_address: 10.64.0.36
+      rpc_address: 10.64.0.36
+      rpc_interface: eth0
+      fqdn: restbase-dev1001-a.eqiad.wmnet
+    b:
+      jmx_port: 7190
+      listen_address: 10.64.0.37
+      rpc_address: 10.64.0.37
+      rpc_interface: eth0
+      fqdn: restbase-dev1001-b.eqiad.wmnet
+  "restbase-dev1002.eqiad.wmnet":
+    a:
+      jmx_port: 7189
+      listen_address: 10.64.32.159
+      rpc_address: 10.64.32.159
+      rpc_interface: eth0
+      fqdn: restbase-dev1002-a.eqiad.wmnet
+    b:
+      jmx_port: 7190
+      listen_address: 10.64.32.160
+      rpc_address: 10.64.32.160
+      rpc_interface: eth0
+      fqdn: restbase-dev1002-b
+  "restbase-dev1003.eqiad.wmnet":
+    a:
+      jmx_port: 7189
+      listen_address: 10.64.48.117
+      rpc_address: 10.64.48.117
+      rpc_interface: eth0
+      fqdn: restbase-dev1003-a.eqiad.wmnet
+    b:
+      jmx_port: 7190
+      listen_address: 10.64.48.118
+      rpc_address: 10.64.48.118
+      rpc_interface: eth0
+      fqdn: restbase-dev1003-b.eqiad.wmnet
+
+profile::cassandra::settings:
+  start_rpc: 'true'
+  max_heap_size: 12g
+  # 1/4 heap size, no more than 100m/thread
+  heap_newsize: 2048m
+  compaction_throughput_mb_per_sec: 20
+  concurrent_compactors: 10
+  concurrent_writes: 18
+  concurrent_reads: 18
+  tls_cluster_name: services=dev
+  internode_encryption: dc
+  dc: "%{::site}"
+  cluster_name: "services-dev"
+  application_username: restb
+  application_password: "%{passwords::cassandra::restbase}"
+  target_version: '3.7'
+  permissions_validity_in_ms: 600000
+  trickle_fsync: false
+  extra_classpath:
+    - 
/srv/deployment/cassandra/twcs/lib/cassandra-v2.2/TimeWindowCompactionStrategy-2.2.5.jar
+  client_encryption_enabled: true
+
+# LVS config
+role::lvs::realserver::pools:
+  restbase: {}
+
+service::configuration::log_dir: "/var/log"
+
+admin::groups:
+  - restbase-roots
+  - restbase-admins
diff --git a/manifests/site.pp b/manifests/site.pp
index d0c477c..c76f28d 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2470,7 +2470,7 @@
 
 # cassandra/restbase dev cluster
 node /^restbase-dev100[1-3]\.eqiad\.wmnet$/ {
-    role(restbase::server, cassandra)
+    role(restbase::dev_cluster)
 }
 
 # network insights (netflow/pmacct, etc.)
diff --git a/modules/profile/manifests/cassandra.pp 
b/modules/profile/manifests/cassandra.pp
new file mode 100644
index 0000000..05f3485
--- /dev/null
+++ b/modules/profile/manifests/cassandra.pp
@@ -0,0 +1,100 @@
+# == Class profile::cassandra
+#
+class profile::cassandra(
+    $all_instances = hiera('profile::cassandra::instances'),
+    $rack = hiera('profile::cassandra::rack'),
+    $cassandra_settings = hiera('profile::cassandra::settings'),
+    $metrics_blacklist = hiera('profile::cassandra::metrics_blacklist'),
+    $metrics_whitelist = hiera('profile::cassandra::metrics_whitelist'),
+    $graphite_host = hiera('graphite_host'),
+    $prometheus_nodes = hiera('prometheus_nodes'),
+) {
+    include ::passwords::cassandra
+    $instances = $all_instances[$::fqdn]
+    # We get the cassandra seeds from $all_instances, with a template hack
+    # This is preferred over a very specialized parser function.
+    $seeds = split(template('profile/cassandra/seeds.erb'), '\|')
+
+    $cassandra_real_settings = merge(
+        {
+            instances => $instances,
+            rack      => $rack,
+            seeds     => $seeds
+        },
+        $cassandra_settings,
+    )
+
+    create_resources('class', {'cassandra' => $cassandra_real_settings})
+
+
+    class { '::cassandra::metrics':
+        graphite_host => $graphite_host,
+        whitelist     => $metrics_whitelist,
+        blacklist     => $metrics_blacklist,
+    }
+    class { '::cassandra::logging': }
+    class { '::cassandra::twcs': }
+
+    class { '::cassandra::sysctl':
+        # Queue page flushes at 24MB intervals
+        vm_dirty_background_bytes => 25165824,
+    }
+
+    if $instances {
+        $instance_names = keys($instances)
+        ::cassandra::instance::monitoring{ $instance_names: }
+    } else {
+        $default_instances = {
+            'default' => {
+                'listen_address' => $::cassandra::listen_address,
+        }}
+        ::cassandra::instance::monitoring{ 'default':
+            instances => $default_instances,
+        }
+    }
+
+    # temporary collector, T78514
+    diamond::collector { 'CassandraCollector':
+        ensure => absent,
+    }
+
+    system::role { 'role::cassandra':
+        description => 'Cassandra server',
+    }
+
+    $cassandra_hosts_ferm = join($seeds, ' ')
+    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')
+
+    # Cassandra intra-node messaging
+    ferm::service { 'cassandra-intra-node':
+        proto  => 'tcp',
+        port   => '7000',
+        srange => "@resolve((${cassandra_hosts_ferm}))",
+    }
+    # Cassandra intra-node SSL messaging
+    ferm::service { 'cassandra-intra-node-ssl':
+        proto  => 'tcp',
+        port   => '7001',
+        srange => "@resolve((${cassandra_hosts_ferm}))",
+    }
+    # Cassandra JMX/RMI
+    ferm::service { 'cassandra-jmx-rmi':
+        proto  => 'tcp',
+        # hardcoded limit of 4 instances per host
+        port   => '7199:7202',
+        srange => "@resolve((${cassandra_hosts_ferm}))",
+    }
+    # Cassandra CQL query interface
+    ferm::service { 'cassandra-cql':
+        proto  => 'tcp',
+        port   => '9042',
+        srange => "@resolve((${cassandra_hosts_ferm}))",
+    }
+    # Prometheus jmx_exporter for Cassandra
+    ferm::service { 'cassandra-jmx_exporter':
+        proto  => 'tcp',
+        port   => '7800',
+        srange => "@resolve((${prometheus_nodes_ferm}))",
+    }
+
+}
diff --git a/modules/profile/manifests/restbase.pp 
b/modules/profile/manifests/restbase.pp
new file mode 100644
index 0000000..f18a2ce
--- /dev/null
+++ b/modules/profile/manifests/restbase.pp
@@ -0,0 +1,153 @@
+# == class profile::restbase
+#
+# sets up a REST API & storage service
+#
+# === Parameters
+#
+# [*cassandra_user*]
+#   Cassandra user name.
+#
+# [*cassandra_password*]
+#   Cassandra password.
+#
+# [*seeds*]
+#   Array of cassandra hosts (IP or host names) to contact.
+#
+# [*cassandra_local_dc*]
+#   Which DC should be considered local.
+#
+# [*cassandra_datacenters*]
+#   The full list of member datacenters.
+#
+# [*cassandra_tls*]
+#   An associative array of TLS options for the Cassandra driver.
+#   See: https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
+#
+# [*logging_label*]
+#   The logging label to use both for logging and statsd.
+#
+# [*monitor_domain*]
+#   The domain to monitor during the service's operation.
+#
+# [*hosts*]
+#   The list of RESTBase hosts used for setting up the rate-limiting DHT.
+#
+# [*parsoid_uri*]
+#   URI to reach Parsoid. Format: http://parsoid.svc.eqiad.wmnet:8000
+#
+# [*graphoid_uri*]
+#   graphoid host + port. Format: http://graphoid.svc.eqiad.wmnet:19000
+#
+# [*mobileapps_uri*]
+#   MobileApps service URI. Format: http://mobileapps.svc.eqiad.wmnet:8888
+#
+# [*mathoid_uri*]
+#   Mathoid service URI. Format: http://mathoid.svc.eqiad.wmnet:10042
+#
+# [*aqs_uri*]
+#   Analytics Query Service URI. Format:
+#   http://aqs.svc.eqiad.wmnet:7232/analytics.wikimedia.org/v1
+#
+# [*eventlogging_service_uri*]
+#   Eventlogging service URI. Format: 
http://eventbus.svc.eqiad.wmnet:8085/v1/events
+#
+# [*pdfrender_uri*]
+#   PDF Render service URI. Format: http://pdfrender.svc.eqiad.wmnet:5252
+#
+# [*citoid_uri*]
+#   Citoid service URI. Format: http://citoid.svc.eqiad.wmnet:1970
+#
+# [*trendingedits_uri*]
+#   Trending edits service URI. Format:
+#   http://trendingedits.svc.eqiad.wmnet:6699
+#
+# [*cxserver_uri*]
+#   CXServer service uri. Format: http://cxserver.discovery.wmnet:8080
+#
+
+class profile::restbase(
+    $cassandra_user = hiera('profile::restbase::cassandra_user'),
+    $cassandra_password = hiera('profile::restbase::cassandra_password'),
+    $seeds = hiera('profile::restbase::seeds'),
+    $cassandra_local_dc = hiera('profile::restbase::cassandra_local_dc'),
+    $cassandra_datacenters = hiera('profile::restbase::cassandra_datacenters'),
+    $cassandra_tls = hiera('profile::restbase::cassandra_tls', {}),
+    $salt_key = hiera('profile::restbase::salt_key'),
+    $logging_label = hiera('profile::restbase::logging_label'),
+    $hosts = hiera('profile::restbase::hosts'),
+    $parsoid_uri = hiera('profile::restbase::parsoid_uri'),
+    $graphoid_uri = hiera('profile::restbase::graphoid_uri'),
+    $mobileapps_uri = hiera('profile::restbase::mobileapps_uri'),
+    $mathoid_uri    = hiera('profile::restbase::mathoid_uri'),
+    $aqs_uri        = hiera('profile::restbase::aqs_uri'),
+    $eventlogging_service_uri = 
hiera('profile::restbase::eventlogging_service_uri'),
+    $pdfrender_uri  = hiera('profile::restbase::pdfrender_uri'),
+    $citoid_uri     = hiera('profile::restbase::citoid_uri'),
+    $trendingedits_uri = hiera('profile::restbase::trendingedits_uri'),
+    $cxserver_uri   = hiera('profile::restbase::cxserver_uri'),
+    $monitor_domain = hiera('profile::restbase::monitor_domain'),
+) {
+    # Default values that need no overriding
+    $port = 7231
+    $page_size = 250
+    $logging_name = $statsd_prefix = $logging_label
+    require ::service::configuration
+    $pdfrender_key = $::service::configuration::pdfrender_key
+    $local_logfile = "${service::configuration::log_dir}/${title}/main.log"
+
+    service::node { 'restbase':
+        port              => $port,
+        no_file           => 200000,
+        healthcheck_url   => "/${monitor_domain}/v1",
+        has_spec          => true,
+        starter_script    => 'restbase/server.js',
+        auto_refresh      => false,
+        deployment        => 'scap3',
+        deployment_config => true,
+        deployment_vars   => {
+            ipaddress                => $::ipaddress,
+            rl_seeds                 => reject(reject($hosts, $::hostname), 
$::ipaddress),
+            seeds                    => $seeds,
+            cassandra_local_dc       => $cassandra_local_dc,
+            cassandra_datacenters    => $cassandra_datacenters,
+            cassandra_user           => $cassandra_user,
+            cassandra_password       => $cassandra_password,
+            cassandra_tls            => $cassandra_tls,
+            parsoid_uri              => $parsoid_uri,
+            graphoid_uri             => $graphoid_uri,
+            mathoid_uri              => $mathoid_uri,
+            mobileapps_uri           => $mobileapps_uri,
+            citoid_uri               => $citoid_uri,
+            eventlogging_service_uri => $eventlogging_service_uri,
+            pdfrender_uri            => $pdfrender_uri,
+            pdfrender_key            => $pdfrender_key,
+            trendingedits_uri        => $trendingedits_uri,
+            cxserver_uri             => $cxserver_uri,
+            aqs_uri                  => $aqs_uri,
+            salt_key                 => $salt_key,
+            page_size                => $page_size,
+        },
+        logging_name      => $logging_name,
+        statsd_prefix     => $statsd_prefix,
+    }
+
+    monitoring::service { 'restbase_http_root':
+        description   => 'Restbase root url',
+        check_command => "check_http_port_url!${port}!/",
+        contact_group => 'admins,team-services',
+    }
+
+    # RESTBase rate limiting DHT firewall rule
+    $rb_hosts_ferm = join(hiera('restbase::hosts'), ' ')
+    ferm::service { 'restbase-ratelimit':
+        proto  => 'tcp',
+        port   => '3050',
+        srange => "@resolve((${rb_hosts_ferm}))",
+    }
+
+    ferm::service {'restbase_web':
+        proto => 'tcp',
+        port  => '7231',
+    }
+
+}
diff --git a/modules/profile/templates/cassandra/seeds.erb 
b/modules/profile/templates/cassandra/seeds.erb
new file mode 100644
index 0000000..46a38e1
--- /dev/null
+++ b/modules/profile/templates/cassandra/seeds.erb
@@ -0,0 +1,8 @@
+<%-
+seeds = []
+@all_instances.each do |host, instances|
+  seeds << host
+  instances.each do |_, data|
+    seeds << data['fqdn']
+  end
+end -%><%= seeds.join "|" -%>
diff --git a/modules/role/manifests/restbase/dev_cluster.pp 
b/modules/role/manifests/restbase/dev_cluster.pp
new file mode 100644
index 0000000..f0e3aae
--- /dev/null
+++ b/modules/role/manifests/restbase/dev_cluster.pp
@@ -0,0 +1,18 @@
+# == Class role::restbase::dev_cluster
+#
+# Configures the restbase dev cluster
+class role::restbase::dev_cluster {
+    include ::passwords::cassandra
+    include ::base::firewall
+    include ::standard
+
+    include ::profile::cassandra
+    include ::profile::restbase
+
+    # TODO: create a base role for deployment-prep
+    if hiera('has_lvs', true) {
+        include ::role::lvs::realserver
+    }
+
+    system::role { 'restbase': description => "Restbase-dev (${::realm})" }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I817204597d421c3bc52a7778e992bd0c1dc473c7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>

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

Reply via email to