diff --git a/templates/pg_hba.conf.j2 b/templates/pg_hba.conf.j2 index c350c33..fc1c4e3 100644 --- a/templates/pg_hba.conf.j2 +++ b/templates/pg_hba.conf.j2 @@ -1,5 +1,5 @@ # "local" is for Unix domain socket connections only -local all all {{ db.postgres.auth }} +local all all peer # IPv4 local connections: host all all 127.0.0.1/32 {{ db.postgres.auth }} # IPv6 local connections: @@ -9,11 +9,11 @@ host all all ::1/128 {{ db.postgres.a {% if db.postgres.replication.enabled is defined %} {% for item in db.postgres.replication.servers %} {% if item | regex_search(".*/.*") %} -host all all {{ item }} md5 -host replication rep {{ item }} md5 +host all all {{ item }} {{ db.postgres.auth }} +host replication rep {{ item }} {{ db.postgres.auth }} {% else %} -host all all {{ item }}/32 md5 -host replication rep {{ item }}/32 md5 +host all all {{ item }}/32 {{ db.postgres.auth }} +host replication rep {{ item }}/32 {{ db.postgres.auth }} {% endif %} {% endfor %} {% endif %}