File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 38
38
#
39
39
40
40
define postgresql::database_user (
41
- $password_hash ,
41
+ $password_hash = false ,
42
42
$createdb = false ,
43
43
$createrole = false ,
44
44
$db = $postgresql::params::user,
Original file line number Diff line number Diff line change 17
17
# limitations under the License.
18
18
19
19
define postgresql::role (
20
- $password_hash ,
20
+ $password_hash = false ,
21
21
$createdb = false ,
22
22
$createrole = false ,
23
23
$db = ' postgres' ,
40
40
$createdb_sql = $createdb ? { true => ' CREATEDB' , default => ' NOCREATEDB' }
41
41
$superuser_sql = $superuser ? { true => ' SUPERUSER' , default => ' NOSUPERUSER' }
42
42
$replication_sql = $replication ? { true => ' REPLICATION' , default => ' ' }
43
+ if ($password_hash != false ) {
44
+ $password_sql = " ENCRYPTED PASSWORD '${password_hash} '"
45
+ } else {
46
+ $password_sql = " "
47
+ }
43
48
44
49
# TODO: FIXME: Will not correct the superuser / createdb / createrole / login / replication status nor the connection limit of a role that already exists
45
- postgresql_psql {"CREATE ROLE \"${username}\" ENCRYPTED PASSWORD '${password_hash}' ${login_sql} ${createrole_sql} ${createdb_sql} ${superuser_sql} ${replication_sql} CONNECTION LIMIT ${connection_limit}" :
50
+ postgresql_psql {"CREATE ROLE \"${username}\" ${password_sql} ${login_sql} ${createrole_sql} ${createdb_sql} ${superuser_sql} ${replication_sql} CONNECTION LIMIT ${connection_limit}" :
46
51
db => $db ,
47
52
psql_user => $postgresql::params::user ,
48
53
unless => " SELECT rolname FROM pg_roles WHERE rolname='${username} '" ,
You can’t perform that action at this time.
0 commit comments