File tree Expand file tree Collapse file tree 3 files changed +24
-17
lines changed Expand file tree Collapse file tree 3 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,9 @@ Weither to grant login capability for the new role. Defaults to `false`.
343
343
####` superuser `
344
344
Weither to grant super user capability for the new role. Defaults to ` false ` .
345
345
346
+ ####` replication `
347
+ If ` true ` provides replication capabilities for this role. Defaults to ` false ` .
348
+
346
349
###Resource: postgresql::tablespace
347
350
This defined type can be used to create a tablespace. For example:
348
351
Original file line number Diff line number Diff line change 39
39
40
40
define postgresql::database_user (
41
41
$password_hash ,
42
- $createdb = false ,
43
- $createrole = false ,
44
- $db = $postgresql::params::user,
45
- $superuser = false ,
46
- $user = $title
42
+ $createdb = false ,
43
+ $createrole = false ,
44
+ $db = $postgresql::params::user,
45
+ $superuser = false ,
46
+ $replication = false ,
47
+ $user = $title
47
48
) {
48
49
postgresql::role { $user:
49
50
db => $db ,
52
53
createdb => $createdb ,
53
54
superuser => $superuser ,
54
55
createrole => $createrole ,
56
+ replication => $replication ,
55
57
}
56
58
}
Original file line number Diff line number Diff line change 18
18
19
19
define postgresql::role (
20
20
$password_hash ,
21
- $createdb = false ,
22
- $createrole = false ,
23
- $db = ' postgres' ,
24
- $login = false ,
25
- $superuser = false ,
26
- $username = $title
21
+ $createdb = false ,
22
+ $createrole = false ,
23
+ $db = ' postgres' ,
24
+ $login = false ,
25
+ $superuser = false ,
26
+ $replication = false ,
27
+ $username = $title
27
28
) {
28
29
include postgresql::params
29
30
33
34
psql_path => $postgresql::params::psql_path ,
34
35
}
35
36
36
- $login_sql = $login ? { true => ' LOGIN' , default => ' NOLOGIN' }
37
- $createrole_sql = $createrole ? { true => ' CREATEROLE' , default => ' NOCREATEROLE' }
38
- $createdb_sql = $createdb ? { true => ' CREATEDB' , default => ' NOCREATEDB' }
39
- $superuser_sql = $superuser ? { true => ' SUPERUSER' , default => ' NOSUPERUSER' }
37
+ $login_sql = $login ? { true => ' LOGIN' , default => ' NOLOGIN' }
38
+ $createrole_sql = $createrole ? { true => ' CREATEROLE' , default => ' NOCREATEROLE' }
39
+ $createdb_sql = $createdb ? { true => ' CREATEDB' , default => ' NOCREATEDB' }
40
+ $superuser_sql = $superuser ? { true => ' SUPERUSER' , default => ' NOSUPERUSER' }
41
+ $replication_sql = $replication ? { true => ' REPLICATION' , default => ' ' }
40
42
41
- # TODO: FIXME: Will not correct the superuser / createdb / createrole / login status of a role that already exists
42
- postgresql_psql {"CREATE ROLE \"${username}\" ENCRYPTED PASSWORD '${password_hash}' ${login_sql} ${createrole_sql} ${createdb_sql} ${superuser_sql}" :
43
+ # TODO: FIXME: Will not correct the superuser / createdb / createrole / login / replication status of a role that already exists
44
+ postgresql_psql {"CREATE ROLE \"${username}\" ENCRYPTED PASSWORD '${password_hash}' ${login_sql} ${createrole_sql} ${createdb_sql} ${superuser_sql} ${replication_sql} " :
43
45
db => $db ,
44
46
psql_user => $postgresql::params::user ,
45
47
unless => " SELECT rolname FROM pg_roles WHERE rolname='${username} '" ,
You can’t perform that action at this time.
0 commit comments