ANXS / postgresql

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

Correct manage setting 'password_encryption' for PostgreSQL 10 and above #460

Closed MemberIT closed 3 years ago

MemberIT commented 4 years ago

PostgreSQL =< 9.6 password_encryption is boolean https://www.postgresql.org/docs/9.6/runtime-config-connection.html PostgreSQL >= 10 password_encryption is enum - 'md5' (default) or 'scram-sha-256'. https://www.postgresql.org/docs/10/runtime-config-connection.html

Duplicates PR https://github.com/ANXS/postgresql/pull/368, but retains backward compatibility with versions below 10.

gclough commented 4 years ago

@MemberIT , could you update this PR?

MemberIT commented 4 years ago

@MemberIT , could you update this PR?

Done.

kravietz commented 4 years ago

@gclough can you merge this one please? It's a bug that the role was being plagued since 2018 and it's a simple fix.

maglub commented 4 years ago

This PR has a suboptimal solution, as the allowed values are not correct.

Why don't we just use a simple solution. We don't have to do the validity check in our role, we can leave it to the user (as we do for many other variables).

Like in PR #460.

password_encryption = {{ postgresql_password_encryption if postgresql_password_encryption else 'off' }}     # md5 or scram-sha-256

For PG11 and 12, valid values are:

MemberIT commented 4 years ago

@maglub I corrected PR in accordance with your comments

maglub commented 4 years ago

Looks good to me, thanks a lot! Who do we chase to get this PR accepted?

robustq commented 3 years ago

@MemberIT Thank you, and @gclough thanks for merging in!