Ottomata has uploaded a new change for review.
https://gerrit.wikimedia.org/r/196665
Change subject: Allow kafka configuration in labs via hiera
......................................................................
Allow kafka configuration in labs via hiera
Change-Id: Iaa7c6ae30ff1ede8394daa01e7b01458fde4d905
---
M manifests/role/analytics/kafka.pp
1 file changed, 16 insertions(+), 17 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/65/196665/1
diff --git a/manifests/role/analytics/kafka.pp
b/manifests/role/analytics/kafka.pp
index defa9b0..462a126 100644
--- a/manifests/role/analytics/kafka.pp
+++ b/manifests/role/analytics/kafka.pp
@@ -17,26 +17,25 @@
class role::analytics::kafka::config {
require role::analytics::zookeeper::config
- # This allows labs to set the $::kafka_cluster global,
- # which will conditionally select labs hosts to include
- # in a Kafka cluster. This allows us to test cross datacenter
- # broker mirroring with multiple clusters.
- $kafka_cluster_name = $::kafka_cluster ? {
- undef => $::site,
- default => $::kafka_cluster,
+ # In production $::site is th cluster name.
+ # In labs, this can be set via hiera, or default to $::instanceproject
+ $kafka_cluster_name = $::realm ? {
+ 'production' => $::site,
+ 'labs' =>
hiera('role::analytics::kafka::config::kafka_cluster_name', $::instanceproject),
}
if ($::realm == 'labs') {
- # TODO: Make hostnames configurable via labs global variables.
- $cluster_config = {
- 'main' => {
- 'kafka-main1.eqiad.wmflabs' => { 'id' => 1 },
- 'kafka-main2.eqiad.wmflabs' => { 'id' => 2 },
- },
- 'external' => {
- 'kafka-external1.eqiad.wmflabs' => { 'id' => 10 },
- },
- }
+ # Look up cluster config via hiera.
+ # This will default to configuring a kafka cluster named
+ # after $::instanceproject with a single kafka broker
+ # that is the current host
+ $cluster_config = hiera('kafka_cluster', {
+ $::instanceproject => {
+ $::fqdn => { 'id' => 1 },
+ },
+ }
+ )
+
# labs only uses a single log_dir
$log_dirs = ['/var/spool/kafka']
# TODO: use variables from new ganglia module once it is finished.
--
To view, visit https://gerrit.wikimedia.org/r/196665
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa7c6ae30ff1ede8394daa01e7b01458fde4d905
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits