Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/allow-user-permissions-definition'
Browse files Browse the repository at this point in the history
refs teohm#8
  • Loading branch information
kohenkatz committed Jul 7, 2015
2 parents 476869b + 4a020f7 commit 8171210
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions recipes/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
include_recipe "postgresql::server"
include_recipe "database::postgresql"

#TODO Chef 11 compat?
node.set['postgresql']['pg_hba'] = [
{:type => 'local', :db => 'all', :user => 'postgres', :addr => nil, :method => 'ident'},
{:type => 'local', :db => 'all', :user => 'all', :addr => nil, :method => 'md5'},
{:type => 'host', :db => 'all', :user => 'all', :addr => '127.0.0.1/32', :method => 'md5'},
{:type => 'host', :db => 'all', :user => 'all', :addr => '::1/128', :method => 'md5'}
]

# Replace the line `local all all ident`
# with `local all all md5`
node.set['postgresql']['pg_hba'].map! do |line|
if line[:type] == 'local' && line[:db] == 'all' && line[:user] == 'all' && line[:addr] == nil && line[:method] == 'ident' then
line[:method] = 'md5'
end
line
end

postgresql_connection_info = {
:host => "localhost",
Expand Down

0 comments on commit 8171210

Please sign in to comment.