Permalink
Browse files

Allow finer tuning inside pg_hba.conf file

  • Loading branch information...
1 parent 05c6379 commit 2d3c0608b1ab81e6e33f18970aa94355cb2c772a @cdoughty77 cdoughty77 committed with Jan 29, 2013
Showing with 5 additions and 4 deletions.
  1. +1 −0 attributes/default.rb
  2. +4 −4 templates/default/pg_hba.conf.erb
View
@@ -12,6 +12,7 @@
default["postgresql"]["environment_variables"] = {}
default["postgresql"]["pg_ctl_options"] = ""
default["postgresql"]["pg_hba"] = []
+default["postgresql"]["pg_hba_defaults"] = true
default["postgresql"]["pg_ident"] = []
default["postgresql"]["start"] = "auto" # auto, manual, disabled
@@ -73,7 +73,7 @@
# configuration parameter, or via the -i or -h command line switches.
<% node["postgresql"]["pg_hba"].each do |hba| %>
-<%= hba %>
+<%= hba['type'] %> <%= hba['db'] %> <%= hba['user'] %> <%= hba['addr'] %> <%= hba['method'] %>
<% end %>
# DO NOT DISABLE!
@@ -82,11 +82,10 @@
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
+# TYPE DATABASE USER ADDRESS METHOD
+<% if node[:postgresql][:pg_hba_defaults] %>
# Database administrative login by Unix domain socket
local all postgres peer
-
-# TYPE DATABASE USER ADDRESS METHOD
-
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
@@ -98,3 +97,4 @@ host all all ::1/128 md5
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
+<% end %>

0 comments on commit 2d3c060

Please sign in to comment.