File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,5 @@ postgresql_backup_command: >-
3535 --keep {{ postgresql_backup_keep | quote }}
3636 {{ '--pg-bin-dir ' ~ __postgresql_pgdg_bin_dir if ansible_os_family == 'RedHat' else '' }}
3737 --backup --clean-archive {{ postgresql_backup_dir | quote }}
38+
39+ postgresql_default_auth_method : " {{ (postgresql_version is version('13', '>')) | ternary('scram-sha-256', 'md5') }}"
Original file line number Diff line number Diff line change 22## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
33##
44
5- {% if postgresql_pg_hba_local_postgres_user is not defined or postgresql_pg_hba_local_postgres_user %}
5+ {% if postgresql_pg_hba_local_postgres_user | default ( true ) | bool %}
66# DO NOT DISABLE!
77# If you change this first entry you will need to make sure that the
88# database superuser can access the database using some other method.
1313local all postgres peer
1414{% endif %}
1515
16- {% if postgresql_pg_hba_local_socket is not defined or postgresql_pg_hba_local_socket %}
16+ # TYPE DATABASE USER ADDRESS METHOD
17+
18+ {% if postgresql_pg_hba_local_socket | default (true ) %}
1719# "local" is for Unix domain socket connections only
1820local all all peer
1921{% endif %}
20- {% if postgresql_pg_hba_local_ipv 4 is not defined or postgresql_pg_hba_local_ipv 4 %}
22+ {% if postgresql_pg_hba_local_ipv 4 | default ( true ) %}
2123# IPv4 local connections:
22- host all all 127.0.0.1/32 md5
24+ host all all 127.0.0.1/32 {{ postgresql_default_auth_method }}
2325{% endif %}
24- {% if postgresql_pg_hba_local_ipv 6 is not defined or postgresql_pg_hba_local_ipv 6 %}
26+ {% if postgresql_pg_hba_local_ipv 6 | default ( true ) %}
2527# IPv6 local connections:
26- host all all ::1/128 md5
28+ host all all ::1/128 {{ postgresql_default_auth_method }}
2729{% endif %}
2830
2931# Entries configured in postgresql_pg_hba_conf follow
3032{% if postgresql_pg_hba_conf is defined %}
31- {% for line in postgresql_pg_hba_conf %}
33+ {% for line in postgresql_pg_hba_conf %}
3234{{ line }}
3335{% endfor %}
3436{% endif %}
Original file line number Diff line number Diff line change 22## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
33##
44
5- {% if postgresql_pg_hba_local_socket is not defined or postgresql_pg_hba_local_socket %}
5+ # TYPE DATABASE USER ADDRESS METHOD
6+
7+ {% if postgresql_pg_hba_local_socket | default (true ) %}
68# "local" is for Unix domain socket connections only
79local all all peer
810{% endif %}
9- {% if postgresql_pg_hba_local_ipv 4 is not defined or postgresql_pg_hba_local_ipv 4 %}
11+ {% if postgresql_pg_hba_local_ipv 4 | default ( true ) %}
1012# IPv4 local connections:
11- host all all 127.0.0.1/32 ident
13+ host all all 127.0.0.1/32 {{ postgresql_default_auth_method }}
1214{% endif %}
13- {% if postgresql_pg_hba_local_ipv 6 is not defined or postgresql_pg_hba_local_ipv 6 %}
15+ {% if postgresql_pg_hba_local_ipv 6 | default ( true ) %}
1416# IPv6 local connections:
15- host all all ::1/128 ident
17+ host all all ::1/128 {{ postgresql_default_auth_method }}
1618{% endif %}
1719
1820# Entries configured in postgresql_pg_hba_conf follow
You can’t perform that action at this time.
0 commit comments