Commit 9881fc9f authored by Илья Крылов's avatar Илья Крылов
Browse files

First commit

parents
patroni_version: 1.6.4
patroni_config_dir: /etc/patroni
patroni_bin_dir: /usr/local/bin
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#global-universal
patroni_scope: main
patroni_namespace: /service/
patroni_name: '{{ ansible_hostname }}'
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#watchdog
# https://patroni.readthedocs.io/en/latest/watchdog.html
patroni_watchdog_mode: automatic # use quotes for 'off' value
patroni_watchdog_device: /dev/watchdog
patroni_watchdog_safety_margin: 5
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#log
patroni_log_destination: logfile
patroni_log_level: INFO
patroni_log_format: '%(asctime)s %(levelname)s: %(message)s'
patroni_log_dateformat: ''
patroni_log_max_queue_size: 1000
patroni_log_dir: /var/log/patroni
patroni_log_file_num: 4
patroni_log_file_size: 25000000
patroni_log_loggers:
- { module: 'patroni.postmaster', level: 'WARNING' }
- { module: 'urllib3', level: 'DEBUG' }
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#postgresql
patroni_system_user: postgres
patroni_system_group: postgres
patroni_replication_username: replicator
patroni_replication_password: repuserpasswd
patroni_superuser_username: postgres
patroni_superuser_password: supersecretpostgrespasswd
patroni_postgresql_version: 12
patroni_exec_start_pre: '/bin/mkdir -m 2750 -p /var/run/postgresql/{{ patroni_postgresql_version }}-main.pg_stat_tmp'
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#rest-api
patroni_restapi_listen: 0.0.0.0:8008
patroni_restapi_connect_address: '{{ ansible_host }}:8008'
patroni_restapi_certfile: ''
patroni_restapi_keyfile: ''
patroni_restapi_username: ''
patroni_restapi_password: ''
# https://patroni.readthedocs.io/en/latest/ENVIRONMENT.html#consul
patroni_consul_host: '127.0.0.1:{{ patroni_consul_port | default(8500) }}'
patroni_consul_port: 8500
patroni_consul_url: ''
patroni_consul_scheme: http
patroni_consul_token: ''
patroni_consul_verify: ''
patroni_consul_cacert: ''
patroni_consul_cert: ''
patroni_consul_key: ''
patroni_consul_dc: ''
patroni_consul_checks: '[]'
patroni_consul_register_service: false
patroni_consul_service_check_interval: 5s
patroni_consul_consistency: default
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#bootstrap-configuration
patroni_bootstrap_dcs_ttl: 30
patroni_bootstrap_dcs_loop_wait: 10
patroni_bootstrap_dcs_retry_timeout: 10
patroni_bootstrap_dcs_maximum_lag_on_failover: 1048576
patroni_bootstrap_dcs_master_start_timeout: 300
patroni_bootstrap_dcs_synchronous_mode: false
patroni_bootstrap_dcs_synchronous_mode_strict: false
patroni_bootstrap_dcs_check_timeline: false
patroni_bootstrap_dcs_standby_cluster:
# - { option: 'host', value: '' }
# - { option: 'port', value: '' }
# - { option: 'primary_slot_name', value: '' }
# - { option: 'create_replica_methods', value: '' }
# - { option: 'restore_command', value: '' }
# - { option: 'archive_cleanup_command', value: '' }
# - { option: 'recovery_min_apply_delay', value: '' }
patroni_bootstrap_dcs_postgresql_use_pg_rewind: true
patroni_bootstrap_dcs_postgresql_use_slots: false
patroni_bootstrap_dcs_postgresql_parameters:
# - { option: 'max_connections', value: '100' }
# - { option: 'max_locks_per_transaction', value: '64' }
# - { option: 'max_worker_processes', value: '8' }
# - { option: 'max_prepared_transactions', value: '0' }
# - { option: 'wal_level', value: 'replica' }
# - { option: 'wal_log_hints', value: 'on' }
# - { option: 'track_commit_timestamp', value: 'off' }
# - { option: 'max_wal_senders', value: '10' }
# - { option: 'max_replication_slots', value: '10' }
# - { option: 'wal_keep_segments', value: '8' }
patroni_bootstrap_dcs_postgresql_recovery_conf: []
# - { option: 'standby_mode', value: 'on' }
# - { option: 'restore_command', value: 'cp ../wal_archive/%f %p' }
patroni_bootstrap_dcs_postgresql_pg_hba: []
# - { type: 'host', database: 'all', user: 'all', address: '0.0.0.0/0', method: 'ident', options: 'map=omicron' }
# - { type: 'host', database: 'replication', user: '{{ patroni_replication_username }}', address: '0.0.0.0/0', method: 'md5' }
patroni_bootstrap_dcs_postgresql_pg_ident: []
# - { mapname: 'omicron', sysuser: 'robert', pguser: 'bob' }
patroni_bootstrap_dcs_slots: []
# - { name: 'permanent_physical_1', type: 'physical' }
# - { name: 'permanent_logical_1', type: 'logical', database: 'foo', plugin: 'pgoutput' }
# https://patroni.readthedocs.io/en/latest/replica_bootstrap.html#bootstrap
patroni_bootstrap_method_name: ''
patroni_bootstrap_method_command: ''
patroni_bootstrap_method_keep_existing_recovery_conf: false
patroni_bootstrap_method_recovery_conf: []
# - { option: 'standby_mode', value: 'on' }
# - { option: 'restore_command', value: 'cp ../wal_archive/%f %p' }
patroni_bootstrap_initdb:
- { option: 'encoding', value: 'UTF8' }
- { option: 'data-checksums' }
patroni_bootstrap_pg_hba: []
# - { type: 'host', database: 'all', user: 'all', address: '0.0.0.0/0', method: 'ident', options: 'map=omicron' }
# - { type: 'host', database: 'replication', user: '{{ patroni_replication_username }}', address: '0.0.0.0/0', method: 'md5' }
patroni_bootstrap_post_bootstrap: ''
patroni_bootstrap_post_init: ''
patroni_bootstrap_users:
- { name: '{{ patroni_superuser_username }}', password: '{{ patroni_superuser_password }}', options: [] }
- { name: '{{ patroni_replication_username }}', password: '{{ patroni_replication_password }}', options: ['replication'] }
patroni_postgresql_use_unix_socket: false
patroni_postgresql_listen: 0.0.0.0:5432
patroni_postgresql_connect_address: '{{ ansible_host }}:5432'
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#postgresql
patroni_postgresql_data_dir: '/var/lib/postgresql/{{ patroni_postgresql_version }}/main'
patroni_postgresql_config_dir: '/etc/postgresql/{{ patroni_postgresql_version }}/main'
patroni_postgresql_bin_dir: '/usr/lib/postgresql/{{ patroni_postgresql_version }}/bin'
patroni_postgresql_pgpass: /var/lib/postgresql/.pgpass
patroni_postgresql_authentication:
- { type: 'superuser', username: '{{ patroni_superuser_username }}', password: '{{ patroni_superuser_password }}' }
- { type: 'replication', username: '{{ patroni_replication_username }}', password: '{{ patroni_replication_password }}' }
patroni_postgresql_callbacks:
- { event: 'on_reload', script: '' }
- { event: 'on_restart', script: '' }
- { event: 'on_role_change', script: '' }
- { event: 'on_start', script: '' }
- { event: 'on_stop', script: '' }
patroni_postgresql_create_replica_methods:
# - pgbackrest
# - wal_e
- basebackup
patroni_postgresql_pgbackrest: []
# - { option: 'command', value: '/usr/bin/pgbackrest --stanza=main --delta restore' }
# - { option: 'keep_data', value: 'true' }
# - { option: 'no_params', value: 'true' }
patroni_postgresql_wal_e: []
# - { option: 'command', value: 'patroni_wale_restore' }
# - { option: 'no_master', value: '1' }
# - { option: 'envdir', value: '/etc/wal_e/envdir' }
# - { option: 'use_iam', value: '1' }
patroni_postgresql_basebackup: []
# - { option: 'checkpoint', value: 'fast' }
# - { option: 'max-rate', value: '100M' }
# - { option: 'verbose' }
patroni_postgresql_recovery_conf: []
# - { option: 'standby_mode', value: 'on' }
# - { option: 'restore_command', value: 'cp ../wal_archive/%f %p' }
patroni_postgresql_custom_conf: ''
patroni_postgresql_parameters:
- { option: 'unix_socket_directories', value: '/var/run/postgresql' }
patroni_postgresql_pg_hba: []
# - { type: 'host', database: 'all', user: 'all', address: '0.0.0.0/0', method: 'ident', options: 'map=omicron' }
# - { type: 'host', database: 'replication', user: '{{ patroni_replication_username }}', address: '0.0.0.0/0', method: 'md5' }
patroni_postgresql_pg_ident: []
# - { mapname: 'omicron', sysuser: 'robert', pguser: 'bob' }
patroni_postgresql_pg_ctl_timeout: 60
patroni_postgresql_remove_data_directory_on_rewind_failure: false
patroni_postgresql_remove_data_directory_on_diverged_timelines: false
# https://patroni.readthedocs.io/en/latest/SETTINGS.html#tags
patroni_tags:
- { name: 'nofailover', value: 'false' }
- { name: 'noloadbalance', value: 'false' }
- { name: 'clonefrom', value: 'false' }
- { name: 'nosync', value: 'false' }
- { name: 'replicatefrom', value: '' }
---
- name: Restart patroni-watchdog
systemd:
name: patroni-watchdog
state: restarted
daemon_reload: yes
enabled: yes
notify:
- Restart watchdog
- name: Restart watchdog
systemd:
name: watchdog
state: restarted
enabled: yes
- name: Restart patroni
systemd:
name: patroni.service
state: restarted
daemon_reload: yes
enabled: yes
galaxy_info:
role_name: patroni
author: Ilya Krylov (krylovia@cloud-team.ru)
description: Patroni installation (with consul support)
company: CloudTeam
license: BSD
dependencies: []
---
- name: Install watchdog for patroni
block:
- name: Create udev rule for watchdog
copy:
content: 'KERNEL=="{{ patroni_watchdog_device |basename }}", OWNER="{{ patroni_system_user }}", GROUP="{{ patroni_system_group }}", MODE="0600"'
dest: /etc/udev/rules.d/60-watchdog.rules
owner: root
group: root
mode: 0644
- name: Install watchdog
package:
name: watchdog
update_cache: yes
- name: Make kernel watchdog device available for patroni
template:
src: patroni-watchdog.service.j2
dest: /etc/systemd/system/patroni-watchdog.service
owner: root
group: root
mode: 0644
notify:
- Restart patroni-watchdog
when: patroni_watchdog_mode in ('automatic', 'required')
- name: Install packages required for Patroni
become: yes
apt: name='{{item}}' state=latest
loop:
- python3-pip
- jq
- name: Install required Python packages for Patroni
become: yes
pip: name='{{ item }}' state=latest
loop:
- psycopg2
- setuptools
- patroni[consul]=={{ patroni_version }}
- name: Create patroni config directory
file:
path: '{{ patroni_config_dir }}'
state: directory
owner: '{{ patroni_system_user }}'
group: '{{ patroni_system_group }}'
mode: 0750
- name: Create patroni log directory
file:
path: '{{ patroni_log_dir }}'
state: directory
owner: '{{ patroni_system_user }}'
group: '{{ patroni_system_group }}'
mode: 0750
when: patroni_log_destination | default('stderr', true) != 'stderr'
- name: Prepare callback scripts
copy:
src: 'callbacks/{{ item.event }}'
dest: '{{ item.script }}'
owner: '{{ patroni_system_user }}'
group: '{{ patroni_system_group }}'
mode: 0750
backup: yes
loop: '{{ patroni_postgresql_callbacks }}'
when: not( (item.script is none) or (item.script | trim | length == 0) )
- name: Create patroni systemd script
template:
src: patroni.systemd.j2
dest: /etc/systemd/system/patroni.service
owner: root
group: root
mode: 0644
- name: Create patroni configuration file
template:
src: patroni.yml.j2
dest: '{{ patroni_config_dir }}/{{ patroni_name|default(ansible_hostname) }}.yml'
owner: '{{ patroni_system_user }}'
group: '{{ patroni_system_group }}'
mode: 0600
notify:
- Restart patroni
# "borrowed" from https://github.com/cybertec-postgresql/patroni-packaging/blob/master/RPM/patroni-watchdog.service
[Unit]
Description=Makes kernel watchdog device available for Patroni
Before=patroni.service
[Service]
Type=oneshot
ExecStart=/sbin/modprobe softdog
[Install]
WantedBy=multi-user.target
# This is an example systemd config file for Patroni
# You can copy it to "/etc/systemd/system/patroni.service",
[Unit]
Description=Runners to orchestrate a high-availability PostgreSQL
After=syslog.target network.target
[Service]
Type=simple
User={{ patroni_system_user }}
Group={{ patroni_system_group }}
# Where to send early-startup messages from the server
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog
ExecStartPre={{ patroni_exec_start_pre | default('') }}
ExecStart={{ patroni_bin_dir }}/patroni {{ patroni_config_dir }}/{{ patroni_name|default(ansible_hostname) }}.yml
# only kill the patroni process, not it's children, so it will gracefully stop postgres
KillMode=process
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=30
# Do not restart the service if it crashes, we want to manually inspect database on failure
Restart=no
[Install]
WantedBy=multi-user.target
#jinja2: lstrip_blocks: True
scope: {{ patroni_scope | default('main', true) }}
namespace: {{ patroni_namespace | default('/service/', true) }}
name: {{ patroni_name | default(ansible_hostname, true) }}
{% if patroni_log_destination | default('stderr', true) != 'stderr' %}
log:
level: {{ patroni_log_level |upper }}
format: {{ patroni_log_format |quote }}
dateformat: {{ patroni_log_dateformat |quote }}
max_queue_size: {{ patroni_log_max_queue_size |int }}
dir: {{ patroni_log_dir }}
file_num: {{ patroni_log_file_num |int }}
file_size: {{ patroni_log_file_size |int }}
{% if patroni_log_loggers | default([], true) |length > 0 %}
loggers:
{% for logger in patroni_log_loggers %}
{{ logger.module }}: {{ logger.level |upper }}
{% endfor %}
{% endif %}
{% endif %}
restapi:
listen: {{ patroni_restapi_listen | default('0.0.0.0:8008', true) }}
connect_address: {{ patroni_restapi_connect_address | default(ansible_host + ':8008', true) }}
{% if patroni_restapi_certfile | default(None, true) and patroni_restapi_keyfile | default(None, true) %}
certfile: {{ patroni_restapi_certfile }}
keyfile: {{ patroni_restapi_keyfile }}
{% endif %}
{% if patroni_restapi_username | default(None, true) and patroni_restapi_password | default(None, true) %}
authentication:
username: {{ patroni_restapi_username }}
password: {{ patroni_restapi_password }}
{% endif %}
consul:
host: {{ patroni_consul_host |d('127.0.0.1:' ~ (patroni_consul_port |d(8500, true)), true) }}
port: {{ patroni_consul_port |d(8500, true) }}
{% if patroni_consul_url |d(None, true) %}
url: {{ patroni_consul_url }}
{% endif %}
{% if patroni_consul_scheme |d(None, true) %}
scheme: {{ patroni_consul_scheme }}
{% endif %}
{% if patroni_consul_token |d(None, true) %}
token: {{ patroni_consul_token }}
{% endif %}
{% if patroni_consul_verify |d(None, true) %}
verify: {{ patroni_consul_verify }}
{% endif %}
{% if patroni_consul_cacert |d(None, true) %}
cacert: {{ patroni_consul_cacert }}
{% endif %}
{% if patroni_consul_cert |d(None, true) %}
cert: {{ patroni_consul_cert }}
{% endif %}
{% if patroni_consul_key |d(None, true) %}
key: {{ patroni_consul_key }}
{% endif %}
{% if patroni_consul_dc |d(None, true) %}
dc: {{ patroni_consul_dc }}
{% endif %}
{% if patroni_consul_checks |d(None, true) %}
checks: {{ patroni_consul_checks }}
{% endif %}
{% if patroni_consul_register_service |d(None, true) %}
register_service: {{ patroni_consul_register_service |lower }}
{% endif %}
{% if patroni_consul_register_service |d(None, true) and patroni_consul_service_check_interval |d(None, true) %}
service_check_interval: {{ patroni_consul_service_check_interval }}
{% endif %}
{% if patroni_consul_consistency |d(None, true) %}
consistency: {{ patroni_consul_consistency }}
{% endif %}
bootstrap:
dcs:
ttl: {{ patroni_bootstrap_dcs_ttl | default(30, true) |int }}
loop_wait: {{ patroni_bootstrap_dcs_loop_wait | default(10, true) |int }}
retry_timeout: {{ patroni_bootstrap_dcs_retry_timeout | default(10, true) |int }}
maximum_lag_on_failover: {{ patroni_bootstrap_dcs_maximum_lag_on_failover | default(1048576, true) |int }}
master_start_timeout: {{ patroni_bootstrap_dcs_master_start_timeout | default(300, true) |int }}
synchronous_mode: {{ patroni_bootstrap_dcs_synchronous_mode | default(false, true) |lower }}
synchronous_mode_strict: {{ patroni_bootstrap_dcs_synchronous_mode_strict | default(false, true) |lower }}
check_timeline: {{ patroni_bootstrap_dcs_check_timeline | default(false, true) |lower }}
{% if patroni_bootstrap_dcs_standby_cluster |map(attribute='value') |join() |trim |length > 0 %}
standby_cluster:
{% for item in patroni_bootstrap_dcs_standby_cluster %}
{{ item.option }}: {{ item.value }}
{% endfor %}
{% endif %}
postgresql:
use_pg_rewind: {{ patroni_bootstrap_dcs_postgresql_use_pg_rewind |string | default(true, true) |replace(None, true) |lower }}
use_slots: {{ patroni_bootstrap_dcs_postgresql_use_slots |string | default(true, true) |replace(None, true) |lower }}
{% if patroni_bootstrap_dcs_postgresql_parameters | default([], true) |length > 0 %}
parameters:
{% for guc in patroni_bootstrap_dcs_postgresql_parameters %}
{{ guc.option }}: {{ guc.value }}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_dcs_postgresql_recovery_conf | default([], true) |length > 0 %}
recovery_conf:
{% for item in patroni_bootstrap_dcs_postgresql_recovery_conf %}
{{ item.option }}: {{ item.value }}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_dcs_postgresql_pg_hba | default([], true) |length > 0 %}
pg_hba:
{% for client in patroni_bootstrap_dcs_postgresql_pg_hba %}
- {{ client.type }} {{ client.database }} {{ client.user }} {{ client.address | default(None) }} {{ client.method }} {{ client.options | default(None) }}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_dcs_postgresql_pg_ident | default([], true) |length > 0 %}
pg_ident:
{% for map in patroni_bootstrap_dcs_postgresql_pg_ident %}
- {{ map.mapname }} {{ map.sysuser }} {{ map.pguser }}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_dcs_slots | default([], true) |length > 0 %}
slots:
{% for slot in patroni_bootstrap_dcs_slots %}
{{ slot.name }}:
type: {{ slot.type }}
{% if slot.type == 'logical' %}
database: {{ slot.database }}
plugin: {{ slot.plugin }}
{% endif %}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_method_name | default(None, true) and patroni_bootstrap_method_command | default(None, true) %}
method: {{ patroni_bootstrap_method_name }}
{{ patroni_bootstrap_method_name }}:
command: {{ patroni_bootstrap_method_command }}
keep_existing_recovery_conf: {{ patroni_bootstrap_method_keep_existing_recovery_conf | default(false, true) |lower }}
{% if patroni_bootstrap_method_recovery_conf | default([], true) |length > 0 %}
recovery_conf:
{% for item in patroni_bootstrap_method_recovery_conf %}
{{ item.option }}: {{ item.value }}
{% endfor %}
{% endif %}
{% endif %}
{% if patroni_bootstrap_initdb | default([], true) |length > 0 %}
initdb:
{% for item in patroni_bootstrap_initdb %}
{% if item.value is undefined %}
- {{ item.option }}
{% else %}
- {{ item.option }}: {{ item.value }}
{% endif %}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_pg_hba | default([], true) |length > 0 %}
pg_hba:
{% for client in patroni_bootstrap_pg_hba %}
- {{ client.type }} {{ client.database }} {{ client.user }} {{ client.address | default(None) }} {{ client.method }} {{ client.options | default(None) }}
{% endfor %}
{% endif %}
{% if patroni_bootstrap_post_bootstrap | default(None, true) %}
post_bootstrap: {{ patroni_bootstrap_post_bootstrap }}
{% endif %}
{% if patroni_bootstrap_post_init | default(None, true) %}
post_init: {{ patroni_bootstrap_post_init }}
{% endif %}
{% if patroni_bootstrap_users | default([], true) |length > 0 %}
users:
{% for user in patroni_bootstrap_users %}
{{ user.name }}:
password: {{ user.password }}
{% if user.options | default([], true) |length > 0 %}
options:
{% for option in user.options %}
- {{ option }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
postgresql:
use_unix_socket: {{ patroni_postgresql_use_unix_socket |string | default(true, true) |replace(None, true) |lower }}
listen: {{ patroni_postgresql_listen | default('0.0.0.0:5432', true) }}
connect_address: {{ patroni_postgresql_connect_address | default(ansible_host + ':5432', true) }}
{% if patroni_postgresql_data_dir | default(None, true) %}
data_dir: {{ patroni_postgresql_data_dir }}
{% endif %}
{% if patroni_postgresql_bin_dir | default(None, true) %}
bin_dir: {{ patroni_postgresql_bin_dir }}
{% endif %}
{% if patroni_postgresql_config_dir | default(None, true) %}
config_dir: {{ patroni_postgresql_config_dir }}
{% endif %}
{% if patroni_postgresql_pgpass | default(None, true) %}
pgpass: {{ patroni_postgresql_pgpass }}
{% endif %}
{% if patroni_postgresql_authentication | default([], true) |length > 0 %}
authentication:
{% for role in patroni_postgresql_authentication %}
{{ role.type }}:
username: {{ role.username }}
password: {{ role.password }}
{% endfor %}
{% endif %}
{% if patroni_postgresql_callbacks |map(attribute='script') |join() |trim |length > 0 %}
callbacks:
{% for callback in patroni_postgresql_callbacks %}
{% if callback.script | default(None, true) %}
{{ callback.event }}: {{ callback.script }}
{% endif %}
{% endfor %}
{% endif %}
create_replica_methods:
{% for create_replica_method in patroni_postgresql_create_replica_methods | default(['basebackup'], true) %}
- {{ create_replica_method }}
{% endfor %}
{% for create_replica_method in patroni_postgresql_create_replica_methods | default(['basebackup'], true) %}
{% if (vars['patroni_postgresql_' + create_replica_method]) | default([], true) |length > 0 %}
{{ create_replica_method }}:
{% for item in vars['patroni_postgresql_' + create_replica_method] %}
{% if item.value is undefined %}
{{ item.option }}
{% else %}
{{ item.option }}: {{ item.value }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% if patroni_postgresql_recovery_conf | default([], true) |length > 0 %}
recovery_conf:
{% for item in patroni_postgresql_recovery_conf %}
{{ item.option }}: {{ item.value }}
{% endfor %}
{% endif %}
{% if patroni_postgresql_custom_conf | default(None, true) %}
custom_conf: {{ patroni_postgresql_custom_conf }}
{% endif %}
{% if patroni_postgresql_parameters | default([], true) |length > 0 %}
parameters:
{% for guc in patroni_postgresql_parameters %}
{{ guc.option }}: {{ guc.value }}
{% endfor %}
{% endif %}
{% if patroni_postgresql_pg_hba | default([], true) |length > 0 %}
pg_hba:
{% for client in patroni_postgresql_pg_hba %}
- {{ client.type }} {{ client.database }} {{ client.user }} {{ client.address | default(None) }} {{ client.method }} {{ client.options | default(None) }}
{% endfor %}
{% endif %}
{% if patroni_postgresql_pg_ident | default([], true) |length > 0 %}
pg_ident:
{% for map in patroni_postgresql_pg_ident %}
- {{ map.mapname }} {{ map.sysuser }} {{ map.pguser }}
{% endfor %}
{% endif %}
pg_ctl_timeout: {{ patroni_postgresql_pg_ctl_timeout | default(60, true) |int }}
{% if patroni_bootstrap_dcs_postgresql_use_pg_rewind |bool %}
{% if patroni_superuser_username | default(None, true) and patroni_superuser_password | default(None, true) %}