Skip to content

Commit 03e86aa

Browse files
authored
Replaced tls_cert_generate with host_type in pg_hba.conf.j2 (#1323)
1 parent 9cfc10a commit 03e86aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

automation/roles/patroni/templates/pg_hba.conf.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,18 @@
8585

8686
# TYPE DATABASE USER ADDRESS METHOD
8787
{% for client in postgresql_pg_hba %}
88-
{{ client.type.ljust(9) |default('{% if tls_cert_generate | default(false) | bool %}hostssl{% else %}host{% endif %}') }} {{ client.database.ljust(24) |default('all') }} {{ client.user.ljust(24) |default('all') }} {{ client.address.ljust(24) |default('') }} {{ client.method |default('md5') }} {{ client.options |default(None) }}
88+
{{ client.type.ljust(9) |default('{{ host_type }}') }} {{ client.database.ljust(24) |default('all') }} {{ client.user.ljust(24) |default('all') }} {{ client.address.ljust(24) |default('') }} {{ client.method |default('md5') }} {{ client.options |default(None) }}
8989
{% endfor %}
9090
{% for host in pg_hba_hosts | default(groups['postgres_cluster'] | default([])) %}
91-
{% if tls_cert_generate | default(false) | bool %}hostssl{% else %}host{% endif %} all all {{ hostvars[host]['patroni_bind_address'] | default(hostvars[host]['bind_address'], true) }}/32 {{ postgresql_password_encryption_algorithm }}
91+
{{ host_type }} all all {{ hostvars[host]['patroni_bind_address'] | default(hostvars[host]['bind_address'], true) }}/32 {{ postgresql_password_encryption_algorithm }}
9292
{% endfor %}
9393
# Allow replication connections from localhost, by a user with the
9494
# replication privilege.
9595
{% if patroni_use_unix_socket_repl | default(false) %}
9696
local replication {{ patroni_replication_username }} trust
9797
{% else %}
98-
{% if tls_cert_generate | default(false) | bool %}hostssl{% else %}host{% endif %} replication {{ patroni_replication_username }} localhost trust
98+
{{ host_type }} replication {{ patroni_replication_username }} localhost trust
9999
{% endif %}
100100
{% for host in pg_hba_hosts | default(groups['postgres_cluster'] | default([])) %}
101-
{% if tls_cert_generate | default(false) | bool %}hostssl{% else %}host{% endif %} replication {{ patroni_replication_username }} {{ hostvars[host]['patroni_bind_address'] | default(hostvars[host]['bind_address'], true) }}/32 {{ postgresql_password_encryption_algorithm }}
101+
{{ host_type }} replication {{ patroni_replication_username }} {{ hostvars[host]['patroni_bind_address'] | default(hostvars[host]['bind_address'], true) }}/32 {{ postgresql_password_encryption_algorithm }}
102102
{% endfor %}

0 commit comments

Comments
 (0)