From 4ddd24933a23d8399c4947aca3e3d151effaf27a Mon Sep 17 00:00:00 2001 From: David Smith Date: Sun, 9 Aug 2015 00:46:30 +0200 Subject: [PATCH 1/2] add variable for advertised.host.name --- templates/server.properties.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/server.properties.j2 b/templates/server.properties.j2 index 7d69c94..da79707 100644 --- a/templates/server.properties.j2 +++ b/templates/server.properties.j2 @@ -24,7 +24,11 @@ host.name={{kafka_listen_address}} # Hostname the broker will advertise to producers and consumers. If not set, it uses the # value for "host.name" if configured. Otherwise, it will use the value returned from # java.net.InetAddress.getCanonicalHostName(). +{% if kafka_listen_address is defined %} +advertised.host.name={{kafka_advertised_host_name}} +{% else %} #advertised.host.name= +{% endif %} # The port to publish to ZooKeeper for clients to use. If this is not set, # it will publish the same port that the broker binds to. From f4b668804114362cd224706d675139160cb0bd22 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 11 Aug 2015 00:06:13 +0200 Subject: [PATCH 2/2] copy and paste had left wrong var in if condition --- templates/server.properties.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/server.properties.j2 b/templates/server.properties.j2 index da79707..f49fd73 100644 --- a/templates/server.properties.j2 +++ b/templates/server.properties.j2 @@ -24,7 +24,7 @@ host.name={{kafka_listen_address}} # Hostname the broker will advertise to producers and consumers. If not set, it uses the # value for "host.name" if configured. Otherwise, it will use the value returned from # java.net.InetAddress.getCanonicalHostName(). -{% if kafka_listen_address is defined %} +{% if kafka_advertised_host_name is defined %} advertised.host.name={{kafka_advertised_host_name}} {% else %} #advertised.host.name=