From 12d30acf90f385bf2e3cde19c3e6ce674c9ec022 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 6 Jul 2019 02:49:05 -0400 Subject: [PATCH] Add only coordinators in Patroni config --- roles/pvc/templates/patroni/patroni.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/pvc/templates/patroni/patroni.yml.j2 b/roles/pvc/templates/patroni/patroni.yml.j2 index d43a355..86d8089 100644 --- a/roles/pvc/templates/patroni/patroni.yml.j2 +++ b/roles/pvc/templates/patroni/patroni.yml.j2 @@ -7,7 +7,7 @@ restapi: connect_address: '{{ ansible_hostname }}.{{ pvc_cluster_domain }}:8008' zookeeper: - hosts: [ {% for host in groups[hostvars[inventory_hostname].group_names[0]] %}'{{ host }}.{{ pvc_cluster_domain }}:2181',{% endfor %} ] + hosts: [ {% for node in pvc_nodes if node.is_coordinator %}{{ node.hostname }}.{{ pvc_cluster_domain }}:2181,{% endfor %} ] bootstrap: dcs: