Permalink
Browse files

Merge remote-tracking branch 'remotes/psy-q/allow_passwordless_roles'

  • Loading branch information...
akumria committed Dec 27, 2012
2 parents 993ac6f + e336295 commit 78e0f31c7ebff8e58326ca39da0e1bdfd18b4801
Showing with 9 additions and 2 deletions.
  1. +3 −0 README.md
  2. +6 −2 lib/puppet/provider/pg_user/debian_postgresql.rb
View
@@ -93,6 +93,9 @@ is a member of.
password => 'pgpassword',
}
+To create users without passwords (such as for peer/ident authentication),
+simply leave off the 'password' key.
+
You can also modify other attributes like whether the user can create
databases (`createdb`), create other roles (`createrole`) or is the
superuser (`superuser`).
@@ -8,8 +8,12 @@
optional_commands :su => 'su'
def create
- stm = "create role %s encrypted password '%s'" % [\
- @resource.value(:name), @resource.value(:password) ]
+
+ if @resource.value(:password)
+ password_string = " encrypted password '%s'" % @resource.value(:password)
+ end
+
+ stm = "create role %s#{password_string}" % @resource.value(:name)
if @resource.value(:createdb) == true
stm = stm + " createdb"

0 comments on commit 78e0f31

Please sign in to comment.