Use consistent naming in patroni.yml

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:23 -04:00
parent 0566aadfb0
commit 92ccc0a737
1 changed files with 6 additions and 5 deletions

View File

@ -4,10 +4,10 @@ name: {{ ansible_hostname }}
restapi: restapi:
listen: '0.0.0.0:8008' listen: '0.0.0.0:8008'
connect_address: '{{ ansible_hostname }}.{{ pvc_cluster_domain }}:8008' connect_address: {% for node in pvc_nodes if node.hostname == inventory_hostname %}'{{ node.hostname.split('.')[0] }}.{{ pvc_cluster_domain }}:8008'{% endfor %}
zookeeper: zookeeper:
hosts: [ {% for node in pvc_nodes if node.is_coordinator %}"{{ node.hostname }}.{{ pvc_cluster_domain }}:2181",{% endfor %} ] hosts: [ {% for node in pvc_nodes if node.is_coordinator %}"{{ node.hostname.split('.')[0] }}.{{ pvc_cluster_domain }}:2181"{% if not loop.last %},{% endif %}{% endfor %} ]
bootstrap: bootstrap:
dcs: dcs:
@ -29,8 +29,8 @@ bootstrap:
pg_hba: pg_hba:
- local all all peer - local all all peer
- host replication replicator 127.0.0.1/32 trust - host replication replicator 127.0.0.1/32 trust
{% for host in groups[hostvars[inventory_hostname].group_names[0]] %} {% for node in pvc_nodes if node.is_coordinator %}
- host replication replicator {{ host }}.{{ pvc_cluster_domain }} trust - host replication replicator {{ node.hostname.split('.')[0] }}.{{ pvc_cluster_domain }} trust
{% endfor %} {% endfor %}
- host all all 0.0.0.0/0 md5 - host all all 0.0.0.0/0 md5
@ -43,7 +43,8 @@ bootstrap:
postgresql: postgresql:
listen: '0.0.0.0:5432' listen: '0.0.0.0:5432'
connect_address: '{{ ansible_hostname }}.{{ pvc_cluster_domain }}:5432' connect_address: {% for node in pvc_nodes if node.hostname == inventory_hostname %}'{{ node.hostname.split('.')[0] }}.{{ pvc_cluster_domain }}:5432'
{% endfor %}
log_destination: 'stderr' log_destination: 'stderr'
log_min_messages: INFO log_min_messages: INFO
custom_conf: /etc/postgresql/postgresql.pvc.conf custom_conf: /etc/postgresql/postgresql.pvc.conf