pgbouncer_client_tls_key_file: "{{ pgbouncer_postgresql_ssl_path }}/{{ inventory_hostname }}.key" pgbouncer_client_tls_cert_file: "{{ pgbouncer_postgresql_ssl_path }}/{{ inventory_hostname }}.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 }}" pgbouncer_max_client_conn: 100000 pgbouncer_max_db_connections: 10000 pgbouncer_default_pool_size: 1000 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 ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-push %p' }}" # "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 ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-fetch %f %p' }}" 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' }}" # 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 # PostgreSQL WAL-G postgresql_wal_g_install: true # WAL-G wal_g_install: "{{ postgresql_wal_g_install }}" wal_g_backup_enable: "{{ postgresql_wal_g_backup_enable }}" wal_g_pg_binary: "/usr/bin/wal-g-pg" wal_g_config_name: ".walg.json" wal_g_restore_config_name: ".walg-restore.json" wal_g_backup_retention_enable: "{{ wal_g_backup_enable }}" wal_g_pg_home_dir: "{{ postgresql_home_dir }}" # Monitoring node_exporter_listen_address: "{{ hostvars[inventory_hostname]['ansible_host'] }}" postgres_exporter_listen_address: "{{ hostvars[inventory_hostname]['ansible_host'] }}"