scope: {{ patroni_scope }} name: {{ patroni_name }} restapi: listen: {{ patroni_restapi_listen }} connect_address: {{ patroni_restapi_connect_address }} etcd: hosts: {% for server in groups['etcd'] %} - {{ hostvars[server]['etcd_host'] }}:{{ etcd_client_port }} {% endfor %} bootstrap: dcs: ttl: 30 loop_wait: 10 retry_timeout: 10 maximum_lag_on_failover: 1048576 postgresql: use_pg_rewind: true use_slots: true parameters: wal_level: replica hot_standby: "on" wal_keep_segment: 8 max_wal_senders: 5 max_relication_slots: 5 checkpoint_timeout: 30 initdb: - encoding: UTF8 - data-checksums pg_hba: - host replication repl 127.0.0.1/32 md5 {% for host in patroni_postgresql_replication_hosts %} - host {{ patroni_postgresql_replication_role }} {{ patroni_postgresql_replication_user }} {{ host }} {{ patroni_postgresql_replication_hash_type }} {% endfor %} - host all all 0.0.0.0/0 md5 users: {{ patroni_postgresql_superuser }}: password: {{ patroni_postgresql_superuser_password.stdout }} options: - createrole - createdb {{ patroni_postgresql_replication_user }}: password: {{ patroni_postgresql_replication_password.stdout }} options: - replication postgresql: listen: {{ patroni_postgresql_listen }} connect_address: {{ patroni_postgresql_connect_address }} bin_dir: /usr/lib/postgresql/{{ patroni_postgresql_version }}/bin/ data_dir: {{ patroni_postgresql_datadir }} pgpass: {{ patroni_postgresql_pgpass }} authentication: replication: username: {{ patroni_postgresql_replication_user }} password: {{ patroni_postgresql_replication_password.stdout }} superuser: username: {{ patroni_postgresql_superuser }} password: {{ patroni_postgresql_superuser_password.stdout }} parameters: unix_socket_directories: '/tmp' tags: nofailover: false noloadbalance: false clonefrom: false nosync: false