feat(delivery): integrate PostgreSQL delivery

This commit is contained in:
l x
2026-07-31 10:30:03 +08:00
parent 048ac6507e
commit 66fde73792
25 changed files with 2110 additions and 139 deletions
@@ -0,0 +1,28 @@
# Managed by XINFRA PostgreSQL delivery. instance={{ postgresql_instance_id }}
listen_addresses = '*'
port = {{ postgresql_port_value }}
data_directory = '{{ postgresql_data_dir }}'
hba_file = '{{ postgresql_hba_file }}'
unix_socket_directories = '{{ postgresql_run_dir }}'
external_pid_file = '{{ postgresql_run_dir }}/postmaster.pid'
logging_collector = on
log_directory = '{{ postgresql_log_dir }}'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_min_messages = warning
max_connections = {{ postgresql_max_connections }}
shared_buffers = '{{ postgresql_shared_buffers }}'
effective_cache_size = '{{ postgresql_effective_cache_size }}'
work_mem = '4MB'
maintenance_work_mem = '64MB'
wal_level = replica
max_wal_senders = {{ postgresql_max_wal_senders }}
max_replication_slots = {{ postgresql_max_replication_slots }}
wal_keep_size = '256MB'
hot_standby = on
synchronous_standby_names = ''
{% if postgresql_role == 'primary' %}
primary_conninfo = ''
{% elif postgresql_role == 'replica' %}
primary_conninfo = 'host={{ postgresql_primary_host }} port={{ postgresql_primary_port }} user={{ postgresql_replication_user }} password={{ postgresql_replication_password | replace("'", "''") }} application_name={{ postgresql_instance_id }}'
primary_slot_name = '{{ postgresql_replication_slot }}'
{% endif %}