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

Change subject: webperf: convert to profile/role
......................................................................

webperf: convert to profile/role

Create a profile class. Move the Hiera lookup to parameter of
profile class.

Keep standard and firewall includes in role class.

Use profile::base::firewall instead of base::firewall.

Change-Id: I9d461c6ff3deefa76a14170807cede61a21072e4
---
A modules/profile/manifests/webperf.pp
M modules/role/manifests/webperf.pp
2 files changed, 29 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/55/392655/1

diff --git a/modules/profile/manifests/webperf.pp 
b/modules/profile/manifests/webperf.pp
new file mode 100644
index 0000000..801c9d3
--- /dev/null
+++ b/modules/profile/manifests/webperf.pp
@@ -0,0 +1,27 @@
+class profile::webperf(
+    $statsd = hiera('statsd')
+){
+
+    $statsd_parts = split($statsd, ':')
+    $statsd_host = $statsd_parts[0]
+    $statsd_port = $statsd_parts[1]
+
+    # Use brokers from this Kafka cluster to consume metrics.
+    $kafka_config  = kafka_config('analytics')
+    $kafka_brokers = $kafka_config['brokers']['string']
+
+    # Consume statsd metrics from Kafka and emit them to statsd.
+    class { '::webperf::statsv':
+        kafka_brokers => $kafka_brokers,
+        statsd        => $statsd,
+    }
+
+    # Aggregate client-side latency measurements collected via the
+    # NavigationTiming MediaWiki extension and send them to Graphite.
+    # See <https://www.mediawiki.org/wiki/Extension:NavigationTiming>
+    class { '::webperf::navtiming':
+        kafka_brokers => $kafka_brokers,
+        statsd_host   => $statsd_host,
+        statsd_port   => $statsd_port,
+    }
+}
diff --git a/modules/role/manifests/webperf.pp 
b/modules/role/manifests/webperf.pp
index 80b8388..19a5f0e 100644
--- a/modules/role/manifests/webperf.pp
+++ b/modules/role/manifests/webperf.pp
@@ -6,29 +6,6 @@
 class role::webperf {
 
     include ::standard
-    include ::base::firewall
-
-    $statsd = hiera('statsd')
-    $statsd_parts = split($statsd, ':')
-    $statsd_host = $statsd_parts[0]
-    $statsd_port = $statsd_parts[1]
-
-    # Use brokers from this Kafka cluster to consume metrics.
-    $kafka_config  = kafka_config('analytics')
-    $kafka_brokers = $kafka_config['brokers']['string']
-
-    # Consume statsd metrics from Kafka and emit them to statsd.
-    class { '::webperf::statsv':
-        kafka_brokers => $kafka_brokers,
-        statsd        => $statsd,
-    }
-
-    # Aggregate client-side latency measurements collected via the
-    # NavigationTiming MediaWiki extension and send them to Graphite.
-    # See <https://www.mediawiki.org/wiki/Extension:NavigationTiming>
-    class { '::webperf::navtiming':
-        kafka_brokers => $kafka_brokers,
-        statsd_host   => $statsd_host,
-        statsd_port   => $statsd_port,
-    }
+    include ::profile::base::firewall
+    include ::profile::webperf
 }

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

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

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

Reply via email to