Skip to content
Open
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
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ An example how to include this role as a task:
#### Compatibility matrix


| Distribution / PostgreSQL | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| ------------------------- | :--------: | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Debian 11.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 12.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 13.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Rockylinux 8.x | :no_entry: | :no_entry: | :warning: | :warning: | :warning: | :warning: | :warning: |
| Rockylinux 9.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :warning: |
| Ubuntu 22.04.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 24.04.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Distribution / PostgreSQL | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| ------------------------- | :--------: | :--------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Debian 11.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 12.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Debian 13.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Rockylinux 8.x | :no_entry: | :no_entry: | :warning: | :warning: | :warning: | :warning: | :warning: | :warning: |
| Rockylinux 9.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :warning: | :warning: |
| Ubuntu 22.04.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 24.04.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |


- :white_check_mark: - works fine
Expand All @@ -75,7 +75,7 @@ An example how to include this role as a task:

```yaml
# Basic settings
postgresql_version: 17
postgresql_version: 18
postgresql_encoding: "UTF-8"
postgresql_locale: "en_US.UTF-8"
postgresql_ctype: "en_US.UTF-8"
Expand Down
35 changes: 31 additions & 4 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: 17
postgresql_version: 18
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 @@ -49,6 +49,7 @@ postgresql_postgis_release_compatibility:
15: "3.2"
16: "3.4"
17: "3.5"
18: "3.6"

postgresql_ext_postgis_version: "{{ postgresql_postgis_release_compatibility.get(postgresql_version) }}"
postgresql_ext_postgis_version_terse: "{{ postgresql_ext_postgis_version | replace('.','') }}"
Expand Down Expand Up @@ -155,6 +156,8 @@ postgresql_authentication_timeout: 60s # 1s-600s
postgresql_password_encryption: "{{ 'scram-sha-256' if postgresql_version is version_compare('14', '>=') else 'md5' }}" # (>=14.0 set to scram-sha-256 for best security)
posgresql_scram_iterations: 4096 # (>= 16)
postgresql_db_user_namespace: off # (<= 16)
postgresql_md5_password_warnings: on # (>= 18)
postgresql_oauth_validator_libraries: [] # (>= 18) comma-separated list of trusted validator modules

# GSSAPI using Kerberos
postgresql_krb_server_keyfile: "{{ 'FILE:${sysconfdir}/krb5.keytab' if postgresql_version is version_compare('14', '>=') else '' }}"
Expand All @@ -170,8 +173,10 @@ postgresql_ssl_ciphers:
- "MEDIUM"
- "+3DES"
- "!aNULL"
postgresql_ssl_tls13_ciphers: "" # (>= 18) allowed TLSv1.3 cipher suites, blank for default
postgresql_ssl_prefer_server_ciphers: on
postgresql_ssl_ecdh_curve: "prime256v1"
postgresql_ssl_ecdh_curve: "prime256v1" # (<= 17, renamed to postgresql_ssl_groups in 18)
postgresql_ssl_groups: "X25519:prime256v1" # (>= 18) replaces ssl_ecdh_curve; colon-separated list
postgresql_ssl_min_protocol_version: "TLSv1.2" # (>= 12)
postgresql_ssl_max_protocol_version: "" # (>= 12)
postgresql_ssl_dh_params_file: "" # (>= 10)
Expand Down Expand Up @@ -232,6 +237,8 @@ postgresql_transaction_buffers: 0 # (>= 17) memory for pg_xact (0 = auto)
# limits per-process temp file space in kB, or -1 for no limit (>= 9.2)
postgresql_temp_file_limit: -1

postgresql_file_copy_method: "copy" # (>= 18) copy, clone (if supported by OS)

postgresql_max_notify_queue_pages: 1048576 # (>= 17)

# - Kernel Resources -
Expand All @@ -256,9 +263,13 @@ postgresql_bgwriter_flush_after: 512kB # measured in pages, 0 disables
# - Asynchronous Behavior -

postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default is 0
postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
postgresql_maintenance_io_concurrency: 10 # (>= 13)
postgresql_effective_io_concurrency: "{{ 16 if postgresql_version is version_compare('18', '>=') else 1 }}" # 1-1000; 0 disables prefetching
postgresql_maintenance_io_concurrency: "{{ 16 if postgresql_version is version_compare('18', '>=') else 10 }}" # (>= 13)
postgresql_io_combine_limit: 128kB # (>= 17) usually 1-32 blocks (depends on OS)
postgresql_io_max_combine_limit: 128kB # (>= 18) usually 1-128 blocks (depends on OS) (change requires restart)
postgresql_io_method: "worker" # (>= 18) worker, io_uring, sync (change requires restart)
postgresql_io_max_concurrency: -1 # (>= 18) max IOs one process can execute simultaneously; -1 sets based on shared_buffers (change requires restart)
postgresql_io_workers: 3 # (>= 18) 1-32
postgresql_max_worker_processes: 8 # (change requires restart)
postgresql_max_parallel_workers_per_gather: 2 # (>= 9.6) taken from max_worker_processes
postgresql_max_parallel_maintenance_workers: 2 # (>= 11) taken from max_parallel_workers
Expand Down Expand Up @@ -350,6 +361,7 @@ postgresql_wal_sender_delay: 1s # walsender cycle time, 1-10000 milliseconds
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_idle_replication_slot_timeout: 0 # (>= 18) in seconds; 0 disables
postgresql_replication_timeout: 60s # in milliseconds; 0 disables (<= 9.2)
postgresql_wal_sender_timeout: 60s # in milliseconds; 0 disables (>= 9.3)
postgresql_track_commit_timestamp: off # (>= 9.5)
Expand Down Expand Up @@ -390,6 +402,8 @@ postgresql_sync_replication_slots: off # (>= 17) enables slot synchronizat

# - Subscribers - (>= 10)
# These settings are ignored on a publisher.
postgresql_max_active_replication_origins: 10 # (>= 18) max number of active replication origins
# (change requires restart)
postgresql_max_logical_replication_workers: 4 # (>= 10) taken from max_worker_processes
# (change requires restart)
postgresql_max_sync_workers_per_subscription: 2 # (>= 10) taken from max_logical_replication_workers
Expand Down Expand Up @@ -421,6 +435,8 @@ postgresql_enable_seqscan: on
postgresql_enable_sort: on
postgresql_enable_tidscan: on
postgresql_enable_group_by_reordering: on
postgresql_enable_distinct_reordering: on # (>= 18)
postgresql_enable_self_join_elimination: on # (>= 18)

# - Planner Cost Constants -
postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
Expand Down Expand Up @@ -550,6 +566,8 @@ postgresql_debug_pretty_print: on
postgresql_log_autovacuum_min_duration: "{{ '10min' if postgresql_version is version_compare('15', '>=') else -1 }}"
postgresql_log_checkpoints: "{{ 'on' if postgresql_version is version_compare('15', '>=') else 'off' }}"
postgresql_log_connections: off
postgresql_log_connections_options: "" # (>= 18) replaces boolean log_connections; comma-separated:
# receipt, authentication, authorization, setup_durations, all
postgresql_log_disconnections: off
postgresql_log_duration: off
postgresql_log_error_verbosity: "default" # terse, default, or verbose messages
Expand Down Expand Up @@ -582,6 +600,7 @@ postgresql_log_line_prefix: "%m [%p] "

# log lock waits >= deadlock_timeout
postgresql_log_lock_waits: off
postgresql_log_lock_failures: off # (>= 18) log lock failures
postgresql_log_recovery_conflict_waits: off # (>= 14)
postgresql_log_parameter_max_length: -1 # (>= 13)
postgresql_log_parameter_max_length_on_error: 0 # (>= 13)
Expand All @@ -606,6 +625,7 @@ postgresql_update_process_title: on # (>= 9.2)
postgresql_track_activities: on
postgresql_track_activity_query_size: 1024
postgresql_track_counts: on
postgresql_track_cost_delay_timing: off # (>= 18)
postgresql_track_io_timing: off # (>= 9.2)
postgresql_track_wal_io_timing: off # (>= 14)
postgresql_track_functions: "none" # none, pl, all
Expand All @@ -625,6 +645,8 @@ postgresql_log_statement_stats: off

# Enable autovacuum subprocess? 'on' requires track_counts to also be on.
postgresql_autovacuum: on
postgresql_autovacuum_worker_slots: 16 # (>= 18) autovacuum worker slots to allocate
# (change requires restart)
# -1 disables, 0 logs all actions and their durations, > 0 logs only
# actions running at least this number of milliseconds.
# max number of autovacuum subprocesses
Expand All @@ -641,6 +663,8 @@ 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
postgresql_autovacuum_vacuum_max_threshold: 100000000 # (>= 18) max number of row updates before
# vacuum; -1 disables max threshold
# maximum XID age before forced vacuum
postgresql_autovacuum_freeze_max_age: 200000000
# maximum Multixact age before forced vacuum (>= 9.3)
Expand Down Expand Up @@ -689,12 +713,14 @@ postgresql_transaction_timeout: 0 # (>= 17) in milli
postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3)
postgresql_idle_in_transaction_session_timeout: 0 # in milliseconds, 0 is disabled (>= 9.6)
postgresql_idle_session_timeout: 0 # in milliseconds, 0 is disabled (>= 14)
postgresql_vacuum_truncate: on # (>= 18) enable truncation after vacuum
postgresql_vacuum_freeze_table_age: 150000000
postgresql_vacuum_freeze_min_age: 50000000
postgresql_vacuum_failsafe_age: 1600000000 # (>= 14)
postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3)
postgresql_vacuum_multixact_freeze_min_age: 5000000 # (>= 9.3)
postgresql_vacuum_multixact_failsafe_age: 1600000000 # (>= 14)
postgresql_vacuum_max_eager_freeze_failure_rate: 0.03 # (>= 18) 0 disables eager scanning
postgresql_vacuum_cleanup_index_scale_factor: 0.1 # (>= 11 and <= 13)
postgresql_bytea_output: "hex" # hex, escape
postgresql_xmlbinary: "base64"
Expand Down Expand Up @@ -748,6 +774,7 @@ postgresql_jit_provider: "llvmjit" # (>= 11)
# - Other Defaults -

postgresql_dynamic_library_path: "$libdir"
postgresql_extension_control_path: "$system" # (>= 18)
postgresql_extension_destdir: "" # prepend path when loading extensions
# and shared objects (added by Debian)

Expand Down
5 changes: 2 additions & 3 deletions molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ This directory is the home of the test playbooks:

## Molecule

The default tested versions are postgresql 12, 13, 14, 15 and 16 on Debian 11. Linting is disabled for the tests.
The default tested versions are postgresql 13, 14, 15, 16, 17 and 18 on Debian 11. Linting is disabled for the tests.

The default distribution is ubuntu2204. You can override th with setting the environment variable MOLECULE_DISTRO to one of:

* fedora40
* debian11
* debian12
=======
* debian13
* ubuntu2204
* ubuntu2404
Expand All @@ -34,7 +33,7 @@ Prior to the testing, molecule runs the prepare.yml playbook to:
* Create a user called `ansible`, with the default group membership of either `wheel` (CentOS, Fedora), or `sudo` (Debian, ubuntu)
* Install a couple of packages that Jeff Geerling did not install in his container images, that are needed in order to test the role properly

The main file ./molecule/default/molecule.yml sets up versions to test from 12 to 16.
The main file ./molecule/default/molecule.yml sets up versions to test from 13 to 18.

## Tests

Expand Down
10 changes: 10 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ platforms:
pre_build_image: true
cgroupns_mode: host
command: ${MOLECULE_DOCKER_COMMAND:-""}
- name: postgresql-18
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian11}-ansible:latest"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
cgroupns_mode: host
command: ${MOLECULE_DOCKER_COMMAND:-""}
provisioner:
name: ansible
config_options:
Expand All @@ -68,5 +76,7 @@ provisioner:
postgresql_version: 16
postgresql-17:
postgresql_version: 17
postgresql-18:
postgresql_version: 18
verifier:
name: ansible
Loading