postgresql/vars/postgresql.yaml

31 lines
3.1 KiB
YAML
Raw Normal View History

2023-08-11 07:01:30 +00:00
pgbouncer_client_tls_key_file: "{{ pgbouncer_postgresql_ssl_path }}/cert.key"
pgbouncer_client_tls_cert_file: "{{ pgbouncer_postgresql_ssl_path }}/cert.crt"
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 }}"
postgresql_backup_parameters:
archive_command: "{{ postgresql_archive_command if postgresql_wal_g_install else 'cd .' }}"
restore_command: "{{ postgresql_restore_command if postgresql_wal_g_install else 'cd .' }}"
archive_mode: "on"
archive_timeout: "1800s"
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_name ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-push %p' if postgresql_wal_g_install else '' }}"
# "restore_command" written to recovery.conf when configuring follower (create replica)
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_name ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-fetch %f %p' if postgresql_wal_g_install 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 '' }}{{ postgresql_wal_g_binary_name ~ ' --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 '' }}{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
# 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
wal_g_pg: "{{ postgresql_wal_g_install }}"
wal_g_pg_binary_name: "wal-g-pg"
wal_g_config_name: ".walg.json"
wal_g_restore_config_name: ".walg-restore.json"
wal_g_pg_home_dir: "{{ postgresql_home_dir }}"