Skip to content

Commit

Permalink
added hostvar logic for cluster int
Browse files Browse the repository at this point in the history
  • Loading branch information
grierdavid committed Nov 7, 2019
1 parent b65cc37 commit 0ae6b5c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ node }}:9092{% if not loop.last %},{% endif %}{% endfor %}
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:9092{% if not loop.last %},{% endif %}{% endfor %}

# consumer group id
group.id=test-consumer-group
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Maintained by Ansible
#bootstrap.servers=104.130.220.120:9092,104.130.220.119:9092,104.130.220.122:9092
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ node }}:9092{% if not loop.last %},{% endif %}{% endfor %}
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:9092{% if not loop.last %},{% endif %}{% endfor %}
listeners=http://0.0.0.0:8082
client.ssl.endpoint.identification.algorithm=
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintained by Ansible

#bootstrap.servers=104.130.220.120:9092,104.130.220.119:9092,104.130.220.122:9092
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ node }}:9092{% if not loop.last %},{% endif %}{% endfor %}
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:9092{% if not loop.last %},{% endif %}{% endfor %}

#ksql.schema.registry.url=http://104.130.220.122:8081/
ksql.schema.registry.url=http://{{ hostvars[groups['kafka-ksql-schema-node'][0]][['ansible_', hostvars[groups['kafka-ksql-schema-node'][0]]['cluster_interface']]|join]['ipv4']['address'] }}:8081/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ node }}:9092{% if not loop.last %},{% endif %}{% endfor %}
bootstrap.servers={% for node in groups['kafka-server-nodes'] %}{{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:9092{% if not loop.last %},{% endif %}{% endfor %}

# specify the compression codec for all data generated: none, gzip, snappy, lz4, zstd
compression.type=none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ listeners=PLAINTEXT://:9092
#listeners={{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:2888:3888
#{% endfor %}

listeners={% for node in groups['kafka-server-nodes'] %}{{ node }}:9092{% if not loop.last %},{% endif %}{% endfor %}
listeners={% for node in groups['kafka-server-nodes'] %}{{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:9092{% if not loop.last %},{% endif %}{% endfor %}

#zookeeper.connect=104.130.220.120:2181,104.130.220.119:2181,104.130.220.122:2181
zookeeper.connect={% for node in groups['kafka-zk-nodes'] %}{{ node }}:2181{% if not loop.last %},{% endif %}{% endfor %}
zookeeper.connect={% for node in groups['kafka-zk-nodes'] %}{{ hostvars[node]['ansible_'~hostvars[node].cluster_interface|default(hostvars[node].ansible_default_ipv4.alias)]['ipv4']['address'] }}:2181{% if not loop.last %},{% endif %}{% endfor %}

log.dirs=/kafka/data
change to proper mount
Expand Down

0 comments on commit 0ae6b5c

Please sign in to comment.