Initial Chef repository
This commit is contained in:
35
cookbooks/postgresql/templates/default/pg_hba.conf.erb
Normal file
35
cookbooks/postgresql/templates/default/pg_hba.conf.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
# 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 -%>
|
||||
|
||||
###########
|
||||
# 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 %>
|
||||
|
||||
# "local" is for Unix domain socket connections only
|
||||
<% if node['postgresql']['version'].to_f < 9.1 -%>
|
||||
local all all ident
|
||||
<% elsif node['postgresql']['version'].to_f >= 9.1 -%>
|
||||
local all all peer
|
||||
<% end -%>
|
||||
@@ -0,0 +1,4 @@
|
||||
PGDATA=<%= node['postgresql']['dir'] %>
|
||||
<% if node['postgresql']['config'].attribute?("port") -%>
|
||||
PGPORT=<%= node['postgresql']['config']['port'] %>
|
||||
<% end -%>
|
||||
21
cookbooks/postgresql/templates/default/postgresql.conf.erb
Normal file
21
cookbooks/postgresql/templates/default/postgresql.conf.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
# PostgreSQL configuration file
|
||||
# This file was automatically generated and dropped off by chef!
|
||||
# Please refer to the PostgreSQL documentation for details on
|
||||
# configuration settings.
|
||||
|
||||
<% node['postgresql']['config'].sort.each do |key, value| %>
|
||||
<% next if value.nil? -%>
|
||||
<% next if node['postgresql']['version'].to_f < 9.2 && /ssl_.*._file/.match(key) -%>
|
||||
<%= key %> = <%=
|
||||
case value
|
||||
when String
|
||||
"'#{value}'"
|
||||
when TrueClass
|
||||
'on'
|
||||
when FalseClass
|
||||
'off'
|
||||
else
|
||||
value
|
||||
end
|
||||
%>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user