Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support PostgreSQL v13 #504

Merged
merged 7 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ services:

env:
matrix:
## DISABLED ## - IMAGE_NAME="ubuntu:16.04-builded"
- IMAGE_NAME="debian:8-builded"
- IMAGE_NAME="debian:9-builded"
- IMAGE_NAME="centos:7-builded"
## NOT WORKING YET ## - IMAGE_NAME="centos:8-builded"
- IMAGE_NAME="debian:9-builded"
## NOT WORKING YET ## - IMAGE_NAME="debian:10-builded"
## NOT WORKING YET ## - IMAGE_NAME="ubuntu:18.04-builded"
## NOT WORKING YET ## - IMAGE_NAME="ubuntu:20.04-builded"
## DISABLED ## - IMAGE_NAME="fedora:27-builded"
install:
- pip install ansible=="2.4.4.0" docker-py
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ Including an example of how to use your role:

| Distribution / PostgreSQL | 9.5 | 9.6 | 10 | 11 | 12 | 13 |
| ------------------------- |:---:|:---:|:--:|:--:|:--:|:--:|
| Debian 8.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:no_entry: |
| Debian 9.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:no_entry: |
| CentOS 7.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:no_entry: |
| CentOS 8.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :no_entry: |
| Fedora latest | :x: | :x: | :x: | :x: | :x: | :x: |
| CentOS 7.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| CentOS 8.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Debian 9.x | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 10.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Ubuntu 18.04.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Ubuntu 20.04.x | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |
| Fedora latest | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: | :grey_question: |

- :white_check_mark: - tested, works fine
- :warning: - Not for production use
Expand All @@ -54,7 +56,7 @@ Including an example of how to use your role:

```yaml
# Basic settings
postgresql_version: 12
postgresql_version: 13
postgresql_encoding: "UTF-8"
postgresql_locale: "en_US.UTF-8"
postgresql_ctype: "en_US.UTF-8"
Expand Down
42 changes: 34 additions & 8 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# file: postgresql/defaults/main.yml

# Basic settings
postgresql_version: 12
postgresql_version: 13
postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}" # Short version of the postgresql_version, used in some path and filenames
postgresql_encoding: "UTF-8"
postgresql_data_checksums: false
Expand Down Expand Up @@ -40,7 +40,16 @@ postgresql_ext_install_contrib: no
postgresql_ext_install_dev_headers: no
postgresql_ext_install_postgis: no

postgresql_ext_postgis_version: "2.5" # be careful: check whether the postgresql/postgis versions work together
# PostGIS
postgresql_postgis_release_compatibility:
9.5: "3.0"
9.6: "3.1"
10: "3.1"
12: "3.1"
13: "3.1"

postgresql_ext_postgis_version: "{{ postgresql_postgis_release_compatibility.get(postgresql_version) }}"
postgresql_ext_postgis_version_terse: "{{ postgresql_ext_postgis_version | replace('.','') }}"

postgresql_ext_postgis_deps:
- libgeos-c1
Expand Down Expand Up @@ -138,7 +147,7 @@ postgresql_ssl_ciphers:
- "@STRENGTH"
postgresql_ssl_prefer_server_ciphers: on
postgresql_ssl_ecdh_curve: "prime256v1"
postgresql_ssl_min_protocol_version: "TLSv1" # (>= 12)
postgresql_ssl_min_protocol_version: "TLSv1.2" # (>= 12)
postgresql_ssl_max_protocol_version: "" # (>= 12)
postgresql_ssl_dh_params_file: "" # (>= 10)
postgresql_ssl_passphrase_command: "" # (>= 11)
Expand All @@ -148,7 +157,7 @@ postgresql_ssl_cert_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem" # (>= 9.2)
postgresql_ssl_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key" # (>= 9.2)
postgresql_ssl_ca_file: "" # (>= 9.2)
postgresql_ssl_crl_file: "" # (>= 9.2)
postgresql_password_encryption: on
postgresql_password_encryption: "{{ 'md5' if postgresql_version is version_compare('10', '>=') else 'on' }}" # (>=10.0 set to scram-sha-256 for best security)
postgresql_db_user_namespace: off
postgresql_row_security: off # (>= 9.5)

Expand Down Expand Up @@ -179,9 +188,11 @@ postgresql_temp_buffers: 8MB # min 800kB
postgresql_max_prepared_transactions: 0 # zero disables the feature

postgresql_work_mem: 1MB # min 64kB
postgresql_hash_mem_multiplier: 1.0 # (>= 13)
postgresql_maintenance_work_mem: 16MB # min 1MB
postgresql_replacement_sort_tuples: 150000 # (>= 9.6) limits use of replacement selection sort
postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
postgresql_logical_decoding_work_mem: 64MB # (>= 13)
postgresql_max_stack_depth: 2MB # min 100kB
postgresql_shared_memory_type: "mmap" # (>= 12)

Expand Down Expand Up @@ -227,6 +238,7 @@ postgresql_bgwriter_flush_after: 0 # (>= 9.6) 0 disables,
# - Asynchronous Behavior -

postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
postgresql_maintenance_io_concurrency: 10 # (>= 13)
postgresql_max_worker_processes: 8 # (change requires restart)
postgresql_max_parallel_maintenance_workers: 2 # (>= 11) taken from max_parallel_workers
postgresql_max_parallel_workers_per_gather: 0 # (>= 9.6) taken from max_worker_processes
Expand All @@ -243,7 +255,7 @@ postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default

# - Settings -

postgresql_wal_level: "minimal" # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical
postgresql_wal_level: "replica" # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical
postgresql_fsync: on # flush data to disk for crash safety
# (turning this off can cause
# unrecoverable data corruption)
Expand Down Expand Up @@ -274,6 +286,7 @@ postgresql_wal_recycle: on # recycle WAL files
postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
postgresql_wal_writer_flush_after: 1MB # (>= 9.6) 0 disables
postgresql_wal_skip_threshold: 2MB # (>= 13)
postgresql_commit_delay: 0 # range 0-100000, in microseconds
postgresql_commit_siblings: 5 # range 1-1000

Expand Down Expand Up @@ -321,6 +334,7 @@ postgresql_primary_slot_name: "" # (>= 12)
postgresql_promote_trigger_file: "" # (>= 12)
postgresql_recovery_min_apply_delay: 0 # (>= 12)


#------------------------------------------------------------------------------
# REPLICATION
#------------------------------------------------------------------------------
Expand All @@ -330,10 +344,13 @@ postgresql_recovery_min_apply_delay: 0 # (>= 12)
# Set these on the master and on any standby that will send replication data.

# max number of walsender processes
postgresql_max_wal_senders: 0
postgresql_max_wal_senders: 10
postgresql_wal_sender_delay: 1s # walsender cycle time, 1-10000 milliseconds (<= 9.1)

postgresql_wal_keep_segments: 0 # in logfile segments, 16MB each; 0 disables
postgresql_wal_keep_segments: 0 # in logfile segments, 16MB each; 0 disables
postgresql_wal_keep_size: 0 # (>= 13)
postgresql_max_slot_wal_keep_size: -1 # (>= 13)

postgresql_replication_timeout: 60s # in milliseconds; 0 disables (<= 9.2)
postgresql_wal_sender_timeout: 60s # in milliseconds; 0 disables (>= 9.3)
postgresql_max_replication_slots: 0 # max number of replication slots
Expand Down Expand Up @@ -362,6 +379,7 @@ postgresql_hot_standby: off
postgresql_max_standby_archive_delay: 30s # -1 allows indefinite delay
# max delay before canceling queries when reading streaming WAL;
postgresql_max_standby_streaming_delay: 30s # -1 allows indefinite delay
postgresql_wal_receiver_create_temp_slot: off # (>= 13)
# send replies at least this often
postgresql_wal_receiver_status_interval: 10s # 0 disables
# send info from standby to prevent query conflicts
Expand Down Expand Up @@ -397,6 +415,7 @@ postgresql_enable_nestloop: on
postgresql_enable_parallel_append: on # (>= 11)
postgresql_enable_seqscan: on
postgresql_enable_sort: on
postgresql_enable_incremental_sort: on # (>= 13)
postgresql_enable_tidscan: on
postgresql_enable_partitionwise_join: off # (>= 11)
postgresql_enable_partitionwise_aggregate: off # (>= 11)
Expand Down Expand Up @@ -533,6 +552,8 @@ postgresql_log_min_error_statement: "error"
# -1 is disabled, 0 logs all statements and their durations, > 0 logs only
# statements running at least this number of milliseconds
postgresql_log_min_duration_statement: -1
postgresql_log_min_duration_sample: -1 # (>= 13)
postgresql_log_statement_sample_rate: 1.0 # (>= 13)
postgresql_log_transaction_sample_rate: 0.0 # (>= 12)


Expand Down Expand Up @@ -573,6 +594,8 @@ postgresql_log_line_prefix: "%t "

# log lock waits >= deadlock_timeout
postgresql_log_lock_waits: off
postgresql_log_parameter_max_length: -1 # (>= 13)
postgresql_log_parameter_max_length_on_error: 0 # (>= 13)
postgresql_log_statement: "none" # none, ddl, mod, all
postgresql_log_replication_commands: off
# log temporary files equal or larger
Expand Down Expand Up @@ -619,10 +642,12 @@ postgresql_autovacuum_max_workers: 3
postgresql_autovacuum_naptime: 1min
# min number of row updates before vacuum
postgresql_autovacuum_vacuum_threshold: 50
postgresql_autovacuum_vacuum_insert_threshold: 1000 # (>= 13)
# min number of row updates before analyze
postgresql_autovacuum_analyze_threshold: 50
# fraction of table size before vacuum
postgresql_autovacuum_vacuum_scale_factor: 0.2
postgresql_autovacuum_vacuum_insert_scale_factor: 0.2 # (>= 13)
# fraction of table size before analyze
postgresql_autovacuum_analyze_scale_factor: 0.1
# maximum XID age before forced vacuum
Expand Down Expand Up @@ -666,7 +691,7 @@ postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3)
postgresql_bytea_output: "hex" # hex, escape
postgresql_xmlbinary: "base64"
postgresql_xmloption: "content"
postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2)
postgresql_gin_fuzzy_search_limit: 0 # (<= 9.2)
postgresql_gin_pending_list_limit: 4MB # (>= 9.5)


Expand Down Expand Up @@ -786,6 +811,7 @@ postgresql_pgtune_type: "Mixed"
# Maximum number of expected connections, if "no", default based on db type
postgresql_pgtune_connections: no


#------------------------------------------------------------------------------
# INSTALL/REPO
#------------------------------------------------------------------------------
Expand Down
17 changes: 11 additions & 6 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@ galaxy_info:
platforms:
- name: Debian
versions:
- jessie
- stretch
## - buster

- name: EL
versions:
- 6
- 7
## - 8

#
# DISABLED
#
# - name: Ubuntu
# versions:
# - bionic
# ## - focal

#
# DISABLED
#
# - name: Ubuntu
# versions:
# - xenial
# - bionic
# - name: Fedora
# versions:
# - 27
Expand Down
Loading