ANXS / postgresql

Fairly full featured Ansible role for Postgresql.
http://anxs.io/
MIT License
848 stars 573 forks source link

few postgres defaults changed in postgres 10, which are not yet reflected in defaults/main.yml #484

Closed neiaberau closed 3 years ago

neiaberau commented 4 years ago

(this is a more general issue than the previous one or overlapping:) it seems, between version 9 and 10 some defaults changed, but got never adapted in defaults/main.yml, was this on purpose as for most installations not relevant or missing?

example: max_wal_senders or wal_level:

defaults/main.yml:postgresql_max_wal_senders: 0 templates/postgresql.conf-10.orig:#max_wal_senders = 10 # max number of walsender processes templates/postgresql.conf-11.orig:#max_wal_senders = 10 # max number of walsender processes templates/postgresql.conf-12.orig:#max_wal_senders = 10 # max number of walsender processes templates/postgresql.conf-9.5.orig:#max_wal_senders = 0 # max number of walsender processes templates/postgresql.conf-9.6.orig:#max_wal_senders = 0 # max number of walsender processes

defaults/main.yml:postgresql_wal_level: "minimal" # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical templates/postgresql.conf-10.orig:#wal_level = replica # minimal, replica, or logical templates/postgresql.conf-11.orig:#wal_level = replica # minimal, replica, or logical templates/postgresql.conf-12.orig:#wal_level = replica # minimal, replica, or logical templates/postgresql.conf-9.5.orig:#wal_level = minimal # minimal, archive, hot_standby, or logical templates/postgresql.conf-9.6.orig:#wal_level = minimal # minimal, replica, or logical

gclough commented 3 years ago

Thanks for the report @neiaberau. I have rolled these updates into #504 , so that PostgreSQL v13 (and the others you've listed) will now get the correct defaults.

defaults/main.yml

postgresql_max_wal_senders: 10
postgresql_wal_level: "replica"  # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical

vars/postgresql_9.5.yml

postgresql_max_wal_senders: 0
postgresql_wal_level: "minimal"

vars/postgresql_9.6.yml

postgresql_max_wal_senders: 0
postgresql_wal_level: "minimal"

That should merge soon, but please review and reopen this if you don't think it's been resolved.

halvaborsch commented 3 years ago

I don't get it what was happened in this commit. How do i can change postgresql_wal_level value in my playbook group_vars or inventory vars now? My variables will be always override with include_vars that has greater priority in ansible variable precedence.

Or i misunderstand something?