2024-05-26 15:04:14 +00:00
|
|
|
postgresql_wal_g_install: true
|
|
|
|
|
|
|
|
pgbouncer_client_tls_key_file: "{{ pgbouncer_postgresql_ssl_path }}/{{ inventory_hostname }}.key"
|
|
|
|
pgbouncer_client_tls_cert_file: "{{ pgbouncer_postgresql_ssl_path }}/{{ inventory_hostname }}.crt"
|
2023-08-11 07:01:30 +00:00
|
|
|
pgbouncer_systemd_user: "postgres"
|
|
|
|
pgbouncer_systemd_group: "postgres"
|
|
|
|
pgbouncer_postgresql_major_version: "{{ postgresql_major_version }}"
|
|
|
|
pgbouncer_postgresql_superuser_username: "{{ postgresql_superuser_username }}"
|
|
|
|
pgbouncer_postgresql_superuser_password: "{{ postgresql_superuser_password }}"
|
2024-05-26 15:04:14 +00:00
|
|
|
pgbouncer_max_client_conn: 100000
|
|
|
|
pgbouncer_max_db_connections: 10000
|
|
|
|
pgbouncer_default_pool_size: 1000
|
2023-08-11 07:01:30 +00:00
|
|
|
|
|
|
|
postgresql_backup_parameters:
|
2024-05-26 15:04:14 +00:00
|
|
|
archive_command: "{{ postgresql_archive_command if postgresql_wal_g_backup_enable else 'cd .' }}"
|
|
|
|
restore_command: "{{ postgresql_restore_command if postgresql_wal_g_backup_enable else 'cd .' }}"
|
2023-08-11 07:01:30 +00:00
|
|
|
archive_mode: "on"
|
|
|
|
archive_timeout: "1800s"
|
|
|
|
|
2024-05-26 15:04:14 +00:00
|
|
|
postgresql_archive_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-push %p' if postgresql_wal_g_backup_enable else '' }}"
|
2023-08-11 07:01:30 +00:00
|
|
|
# "restore_command" written to recovery.conf when configuring follower (create replica)
|
2024-05-26 15:04:14 +00:00
|
|
|
postgresql_restore_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-fetch %f %p' if postgresql_wal_g_backup_enable else '' }}"
|
|
|
|
postgresql_restore_dbs_from_backup_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' backup-fetch ' ~ postgresql_data_dir ~ ' ' ~ postgresql_wal_g_restore_backup_name }}"
|
|
|
|
postgresql_restore_wals_from_backup_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
|
2023-08-11 07:01:30 +00:00
|
|
|
|
|
|
|
# postgresql_restore_command: "wal-g wal-fetch %f %p" # restore WAL-s using WAL-G
|
|
|
|
# postgresql_restore_command: "pgbackrest --stanza={{ pgbackrest_stanza }} archive-get %f %p" # restore WAL-s using pgbackrest
|
|
|
|
# postgresql_restore_command: "pg_probackup-{{ pg_probackup_version }} archive-get -B {{ pg_probackup_dir }} --instance {{ pg_probackup_instance }} --wal-file-path=%p --wal-file-name=%f" # restore WAL-s using pg_probackup
|
|
|
|
|
|
|
|
# WAL-G
|
2024-05-26 15:04:14 +00:00
|
|
|
wal_g_backup_enable: "{{ postgresql_wal_g_backup_enable }}"
|
|
|
|
wal_g_backup_retention_enable: "{{ wal_g_backup_enable }}"
|
2023-08-11 07:01:30 +00:00
|
|
|
wal_g_pg_home_dir: "{{ postgresql_home_dir }}"
|