forked from sous-chefs/postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpg_hba.conf.erb
37 lines (32 loc) · 1.49 KB
/
pg_hba.conf.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This file was automatically generated and dropped off by Chef!
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file.
<% if node['postgresql']['version'].to_f < 9.1 -%>
# TYPE DATABASE USER CIDR-ADDRESS METHOD
<% elsif node['postgresql']['version'].to_f >= 9.1 -%>
# TYPE DATABASE USER ADDRESS METHOD
<% end -%>
# "local" is for Unix domain socket connections only
<% if node['postgresql']['version'].to_f < 8.4 -%>
local all all ident sameuser
<% elsif node['postgresql']['version'].to_f < 9.1 -%>
local all all ident
<% elsif node['postgresql']['version'].to_f >= 9.1 -%>
local all all peer
<% end -%>
###########
# Other authentication configurations taken from chef node defaults:
###########
<% node['postgresql']['pg_hba'].each do |auth| -%>
<% if auth[:comment] %>
<%= auth[:comment] %>
<% end %>
<% if auth[:addr] %>
<%= auth[:type].ljust(7) %> <%= auth[:db].ljust(15) %> <%= auth[:user].ljust(15) %> <%= auth[:addr].ljust(23) %> <%= auth[:method] %>
<% else %>
<%= auth[:type].ljust(7) %> <%= auth[:db].ljust(15) %> <%= auth[:user].ljust(15) %> <%= auth[:method] %>
<% end %>
<% end %>