Skip to content

Commit

Permalink
add postgres ACL config
Browse files Browse the repository at this point in the history
  • Loading branch information
teohm committed Apr 12, 2013
1 parent 1b5796e commit d58018c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions recipes/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
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'}
]


postgresql_connection_info = {
:host => "localhost",
:port => node['postgresql']['config']['port'],
Expand Down

1 comment on commit d58018c

@kohenkatz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes problems if we want to set our own permissions, because it overrides what we set and there's no way to override it.

Instead of resetting the entire list, this should only change the one line that is different:

{:type => 'local', :db => 'all', :user => 'all', :addr => nil, :method => 'md5'},

For example, I want to allow access from other machines on the network, but I can't do it because this overrides anything that I set.

Please sign in to comment.