2019-12-24 14:15:39 -05:00
|
|
|
scope: pvc
|
2019-06-11 16:31:55 -04:00
|
|
|
namespace: /patroni/
|
2019-06-09 00:11:06 -04:00
|
|
|
name: {{ ansible_hostname }}
|
|
|
|
|
|
|
|
restapi:
|
2021-11-11 17:14:34 -05:00
|
|
|
listen: {% for node in pvc_nodes if node.hostname == this_node %}'{{ node.cluster_ip }}:8008'{% endfor %}
|
2021-06-22 03:25:14 -04:00
|
|
|
|
2021-11-11 17:14:34 -05:00
|
|
|
connect_address: {% for node in pvc_nodes if node.hostname == this_node %}'{{ node.cluster_ip }}:8008'{% endfor %}
|
2019-06-09 00:11:06 -04:00
|
|
|
|
|
|
|
zookeeper:
|
2021-06-22 03:25:14 -04:00
|
|
|
hosts: [ {% for node in pvc_nodes if node.is_coordinator %}"{{ node.cluster_ip }}:2181"{% if not loop.last %},{% endif %}{% endfor %} ]
|
2019-06-09 00:11:06 -04:00
|
|
|
|
|
|
|
bootstrap:
|
|
|
|
dcs:
|
|
|
|
ttl: 30
|
|
|
|
loop_wait: 10
|
|
|
|
retry_timeout: 10
|
|
|
|
maximum_lag_on_failover: 1048576
|
|
|
|
postgresql:
|
|
|
|
use_pg_rewind: true
|
2019-06-23 21:03:24 -04:00
|
|
|
parameters:
|
|
|
|
wal_keep_segments: 64
|
|
|
|
max_wal_senders: 8
|
|
|
|
max_replication_slots: 8
|
2019-06-09 00:11:06 -04:00
|
|
|
|
|
|
|
initdb:
|
|
|
|
- encoding: UTF8
|
|
|
|
- data-checksums
|
|
|
|
|
|
|
|
pg_hba:
|
|
|
|
- local all all peer
|
|
|
|
- host replication replicator 127.0.0.1/32 trust
|
2020-04-06 14:11:16 -04:00
|
|
|
{% for node in pvc_nodes if node.is_coordinator %}
|
2021-06-29 16:47:55 -04:00
|
|
|
- host replication replicator {{ node.cluster_ip }}/32 trust
|
2019-06-09 00:11:06 -04:00
|
|
|
{% endfor %}
|
|
|
|
- host all all 0.0.0.0/0 md5
|
|
|
|
|
|
|
|
users:
|
|
|
|
admin:
|
|
|
|
password: admin
|
|
|
|
options:
|
|
|
|
- createrole
|
|
|
|
- createdb
|
|
|
|
|
|
|
|
postgresql:
|
|
|
|
listen: '0.0.0.0:5432'
|
2021-11-11 17:14:34 -05:00
|
|
|
connect_address: {% for node in pvc_nodes if node.hostname == this_node %}'{{ node.cluster_ip }}:5432'
|
2020-04-06 14:11:16 -04:00
|
|
|
{% endfor %}
|
2019-06-09 00:11:06 -04:00
|
|
|
log_destination: 'stderr'
|
|
|
|
log_min_messages: INFO
|
|
|
|
custom_conf: /etc/postgresql/postgresql.pvc.conf
|
|
|
|
bin_dir: /usr/lib/postgresql/11/bin
|
|
|
|
data_dir: /var/lib/postgresql/patroni/pvc
|
|
|
|
pgpass: /tmp/pgpass
|
|
|
|
authentication:
|
|
|
|
replication:
|
|
|
|
username: '{{ pvc_replication_database_user }}'
|
|
|
|
password: '{{ pvc_replication_database_password }}'
|
|
|
|
superuser:
|
|
|
|
username: '{{ pvc_superuser_database_user }}'
|
|
|
|
password: '{{ pvc_superuser_database_password }}'
|
|
|
|
parameters:
|
|
|
|
unix_socket_directories: '/run/postgresql'
|
2019-06-23 21:03:24 -04:00
|
|
|
wal_keep_segments: 64
|
|
|
|
max_wal_senders: 8
|
|
|
|
max_replication_slots: 8
|
2019-06-09 00:11:06 -04:00
|
|
|
|
|
|
|
tags:
|
|
|
|
nofailover: false
|
|
|
|
noloadbalance: false
|
|
|
|
clonefrom: false
|
|
|
|
nosync: false
|