Skip to content

Commit c47559a

Browse files
drnicjhunt
authored andcommitted
if bosh dns2 enabled, support hostname in hba.conf for replication [fixes #11] (#12)
1 parent 1308a07 commit c47559a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

jobs/postgres/templates/config/hba.conf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ local all all md5
1010
<% end %>
1111

1212
# replication hosts
13-
<% link("db").instances.each do |instance|
14-
%>host replication replication <%= instance.address %>/32 trust
15-
<% end %>
13+
<%
14+
link("db").instances.each do |instance|
15+
if instance.address =~ /\b[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\b/
16+
-%>
17+
host replication replication <%= instance.address %>/32 trust
18+
<% else -%>
19+
host replication replication <%= instance.address %> trust
20+
<% end; end -%>
1621

1722
# user-configured acls
1823
<% p("postgres.hba", []).each do |acl| %><%= acl %>

0 commit comments

Comments
 (0)