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: >-
35
35
--keep {{ postgresql_backup_keep | quote }}
36
36
{{ '--pg-bin-dir ' ~ __postgresql_pgdg_bin_dir if ansible_os_family == 'RedHat' else '' }}
37
37
--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 2
2
## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
3
3
##
4
4
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 %}
6
6
# DO NOT DISABLE!
7
7
# If you change this first entry you will need to make sure that the
8
8
# database superuser can access the database using some other method.
13
13
local all postgres peer
14
14
{% endif %}
15
15
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 ) %}
17
19
# "local" is for Unix domain socket connections only
18
20
local all all peer
19
21
{% 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 ) %}
21
23
# 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 }}
23
25
{% 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 ) %}
25
27
# IPv6 local connections:
26
- host all all ::1/128 md5
28
+ host all all ::1/128 {{ postgresql_default_auth_method }}
27
29
{% endif %}
28
30
29
31
# Entries configured in postgresql_pg_hba_conf follow
30
32
{% if postgresql_pg_hba_conf is defined %}
31
- {% for line in postgresql_pg_hba_conf %}
33
+ {% for line in postgresql_pg_hba_conf %}
32
34
{{ line }}
33
35
{% endfor %}
34
36
{% endif %}
Original file line number Diff line number Diff line change 2
2
## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
3
3
##
4
4
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 ) %}
6
8
# "local" is for Unix domain socket connections only
7
9
local all all peer
8
10
{% 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 ) %}
10
12
# 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 }}
12
14
{% 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 ) %}
14
16
# IPv6 local connections:
15
- host all all ::1/128 ident
17
+ host all all ::1/128 {{ postgresql_default_auth_method }}
16
18
{% endif %}
17
19
18
20
# Entries configured in postgresql_pg_hba_conf follow
You can’t perform that action at this time.
0 commit comments