You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
150 lines
4.0 KiB
YAML
150 lines
4.0 KiB
YAML
---
|
|
default_postgres_version: 13
|
|
# distributions:
|
|
# bionic-pgdg
|
|
# bullseye-pgdg
|
|
# buster-pgdg
|
|
# focal-pgdg
|
|
# groovy-pgdg
|
|
# hirsute-pgdg
|
|
# sid-pgdg
|
|
# stretch-pgdg
|
|
# xenial-pgdg
|
|
default_postgres_target_distribution: focal-pgdg
|
|
default_max_connections: 1000
|
|
default_shared_buffers: 256MB
|
|
|
|
database_state: present
|
|
|
|
postgres_homedir: '/var/lib/postgresql'
|
|
|
|
postgres_listen_addresses: "listen_addresses = 'localhost,{{ stage_private_server_ip }}'"
|
|
|
|
postgres_base_config:
|
|
-
|
|
regex: "^data_directory"
|
|
line: "data_directory = '/var/lib/postgresql/{{ default_postgres_version }}/main'"
|
|
-
|
|
regex: "^hba_file"
|
|
line: "hba_file = '/etc/postgresql/{{ default_postgres_version }}/main/pg_hba.conf'"
|
|
-
|
|
regex: "^ident_file"
|
|
line: "ident_file = '/etc/postgresql/{{ default_postgres_version }}/main/pg_ident.conf'"
|
|
-
|
|
regex: "^external_pid_file"
|
|
line: "external_pid_file = '/var/run/postgresql/{{ default_postgres_version }}-main.pid'"
|
|
-
|
|
regex: "^port"
|
|
line: "port = 5432"
|
|
-
|
|
regex: "^unix_socket_directories"
|
|
line: "unix_socket_directories = '/var/run/postgresql'"
|
|
-
|
|
regex: "^dynamic_shared_memory_type"
|
|
line: "dynamic_shared_memory_type = posix"
|
|
-
|
|
regex: "^max_wal_size"
|
|
line: "max_wal_size = 1GB"
|
|
-
|
|
regex: "^min_wal_size"
|
|
line: "min_wal_size = 80MB"
|
|
-
|
|
regex: "^log_line_prefix"
|
|
line: "log_line_prefix = '%m [%p] %q%u@%d '"
|
|
-
|
|
regex: "^log_timezone"
|
|
line: "log_timezone = 'Etc/UTC'"
|
|
-
|
|
regex: "^cluster_name"
|
|
line: "cluster_name = '{{ default_postgres_version }}/main'"
|
|
-
|
|
regex: "^stats_temp_directory"
|
|
line: "stats_temp_directory = '/var/run/postgresql/{{ default_postgres_version }}-main.pg_stat_tmp'"
|
|
-
|
|
regex: "^datestyle"
|
|
line: "datestyle = 'iso, mdy'"
|
|
-
|
|
regex: "^timezone"
|
|
line: "timezone = 'Etc/UTC'"
|
|
-
|
|
regex: "^lc_messages"
|
|
line: "lc_messages = 'en_US.UTF-8'"
|
|
-
|
|
regex: "^lc_monetary"
|
|
line: "lc_monetary = 'en_US.UTF-8'"
|
|
-
|
|
regex: "^lc_numeric"
|
|
line: "lc_numeric = 'en_US.UTF-8'"
|
|
-
|
|
regex: "^lc_time"
|
|
line: "lc_time = 'en_US.UTF-8'"
|
|
-
|
|
regex: "^default_text_search_config"
|
|
line: "default_text_search_config = 'pg_catalog.english'"
|
|
-
|
|
regex: "^include_dir"
|
|
line: "include_dir = 'conf.d'"
|
|
-
|
|
regex: "^wal_level"
|
|
line: "wal_level = replica"
|
|
-
|
|
regex: "^max_wal_senders"
|
|
line: "max_wal_senders = 10"
|
|
-
|
|
regex: "^archive_mode"
|
|
line: "archive_mode = on"
|
|
-
|
|
regex: "^archive_command"
|
|
line: "archive_command = 'cp -f %p /postgresql/replication/%f'"
|
|
-
|
|
regex: "^wal_keep_size"
|
|
line: "wal_keep_size = 16"
|
|
-
|
|
regex: "^listen_addresses = "
|
|
line: "{{ postgres_listen_addresses }}"
|
|
-
|
|
regex: "^max_connections"
|
|
line: "max_connections = {{ default_max_connections }}"
|
|
-
|
|
regex: "^shared_buffers"
|
|
line: "shared_buffers = {{ default_shared_buffers }}"
|
|
|
|
postgres_ssl_config:
|
|
-
|
|
regex: "^ssl = on"
|
|
line: "ssl = on"
|
|
-
|
|
regex: "^ssl_key_file"
|
|
line: "ssl_key_file = '{{ cert_private_key }}'"
|
|
-
|
|
regex: "^ssl_cert_file"
|
|
line: "ssl_cert_file = '{{ cert_public_key }}'"
|
|
-
|
|
regex: "^ssl_ca_file"
|
|
line: "ssl_ca_file = '{{ ca_cert }}'"
|
|
-
|
|
regex: "^ssl_ciphers"
|
|
line: "ssl_ciphers = 'HIGH'"
|
|
|
|
postgres_config : '{{ postgres_base_config + ( postgres_ssl_config | default([]) ) }}'
|
|
|
|
prometheus_postgres_exporter_config:
|
|
-
|
|
regex: "^ARGS="
|
|
line: "ARGS=\"--web.listen-address='{{ stage_private_server_ip }}:{{ monitor_port_postgres }}'\""
|
|
-
|
|
regex: "^DATA_SOURCE_URI"
|
|
line: "DATA_SOURCE_URI='postgres@:5432/postgres?host=/var/run/postgresql'"
|
|
-
|
|
regex: "^PG_EXPORTER_AUTO_DISCOVER_DATABASES"
|
|
line: "PG_EXPORTER_AUTO_DISCOVER_DATABASES=true"
|
|
-
|
|
regex: "^PG_EXPORTER_EXTEND_QUERY_PATH"
|
|
line: "PG_EXPORTER_EXTEND_QUERY_PATH=/metrics/queries.yaml"
|
|
|
|
|
|
|
|
database_engine: postgres
|
|
backup_dest_dir: "{{ backup_directory }}/{{ database_engine }}/{{ get_current_date }}"
|
|
backup_status_file: '{{ backup_dest_dir }}/backup_finished'
|