Ottomata has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369727 )

Change subject: Manage /srv/kafka to be nice in profile, don't render zk 
settings if undef
......................................................................


Manage /srv/kafka to be nice in profile, don't render zk settings if undef

Bug: T166162
Change-Id: I4ae3c11475af0f769899ff06f2d2174b879e2a1d
---
M modules/confluent/templates/kafka/server.properties.erb
M modules/profile/manifests/kafka/broker.pp
2 files changed, 16 insertions(+), 2 deletions(-)

Approvals:
  Ottomata: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/confluent/templates/kafka/server.properties.erb 
b/modules/confluent/templates/kafka/server.properties.erb
index 34e654a..c2a8fe6 100644
--- a/modules/confluent/templates/kafka/server.properties.erb
+++ b/modules/confluent/templates/kafka/server.properties.erb
@@ -242,15 +242,19 @@
 # root directory for all kafka znodes.
 zookeeper.connect=<%= @zookeeper_connect %>
 
+<% if @zookeeper_connection_timeout_ms -%>
 # Timeout in ms for connecting to zookeeper
 zookeeper.connection.timeout.ms=<%= @zookeeper_connection_timeout_ms %>
 
+<% end -%>
+<% if @zookeeper_session_timeout_ms -%>
 # Zookeeper session timeout. If the server fails to heartbeat to Zookeeper
 # within this period of time it is considered dead. If you set this too low
 # the server may be falsely considered dead; if you set it too high it may
 # take too long to recognize a truly dead server.
 zookeeper.session.timeout.ms=<%= @zookeeper_session_timeout_ms %>
 
+<% end -%>
 ##################### Confluent Proactive Support ######################
 # If set to true, and confluent-support-metrics package is installed
 # then the feature to collect and report support metrics
diff --git a/modules/profile/manifests/kafka/broker.pp 
b/modules/profile/manifests/kafka/broker.pp
index fb353be..b7a1a19 100644
--- a/modules/profile/manifests/kafka/broker.pp
+++ b/modules/profile/manifests/kafka/broker.pp
@@ -34,8 +34,9 @@
 #
 # [*log_dirs*]
 #   Array of Kafka log data directories.  The confluent::kafka::broker class
-#   manages these directories but not anything above them.
-#   You must ensure that any parent directories exist outside of this class.
+#   manages these directories but not anything above them.  Unless the prefix
+#   is /srv/kafka, then this profile tries to be nice.  Otherwise,
+#   you must ensure that any parent directories exist outside of this class.
 #   Hiera: profile::kafka::broker::log_dirs
 #
 # [*auto_leader_rebalance_enable*]
@@ -143,6 +144,15 @@
         $ssl_truststore_password        = undef
     }
 
+    # Be nice, and manage /srv/kafka if it is the prefix for kafka data 
directories.
+    # This is the common case.
+    if '/srv/kafka' in $log_dirs[0] and !defined(File['/srv/kafka']) {
+        file { '/srv/kafka':
+            ensure => 'directory',
+            mode   => '0755',
+        }
+    }
+
     class { '::confluent::kafka::client':
         # TODO: These should be removed once they are
         # the default in ::confluent::kafka module

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ae3c11475af0f769899ff06f2d2174b879e2a1d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <ao...@wikimedia.org>
Gerrit-Reviewer: Ottomata <ao...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to