diff --git a/roles/pvc/templates/zookeeper/prometheus.env.j2 b/roles/pvc/templates/zookeeper/prometheus.env.j2 index a3ebe22..465c143 100644 --- a/roles/pvc/templates/zookeeper/prometheus.env.j2 +++ b/roles/pvc/templates/zookeeper/prometheus.env.j2 @@ -1,5 +1,4 @@ # Zookeeper Prometheus exporter arguments # {{ ansible_managed }} -# Set the zk-hosts to our cluster local IP address as this is where Zookeeper listens -ARGS="-zk-hosts='{% for node in pvc_nodes if node.hostname == this_node %}{{ node.cluster_ip }}{% endfor %}:2181'" +ARGS="-zk-hosts='{% for node in pvc_nodes if node.is_coordinator %}{{ node.cluster_ip }}:2181{% if not loop.last %},{% endif %}{% endfor %}'"