Skip to content

Commit 2d652f7

Browse files
committed
add parameter with_admin_option
1 parent e8c1db2 commit 2d652f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

manifests/server/grant_role.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# @param psql_user Sets the OS user to run psql.
88
# @param port Port to use when connecting.
99
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
10+
# @param with_admin_option Specifies if the role should be granted with admin option.
1011
define postgresql::server::grant_role (
1112
String[1] $group,
1213
String[1] $role = $name,
@@ -15,10 +16,12 @@
1516
$psql_user = $postgresql::server::user,
1617
$port = $postgresql::server::port,
1718
$connect_settings = $postgresql::server::default_connect_settings,
19+
$with_admin_option = false,
1820
) {
1921
case $ensure {
2022
'present': {
21-
$command = "GRANT \"${group}\" TO \"${role}\""
23+
$with_admin_option_sql = $with_admin_option ? { true => 'WITH ADMIN OPTION', default => '' }
24+
$command = "GRANT \"${group}\" TO \"${role}\" ${with_admin_option_sql}"
2225
$unless_comp = '='
2326
}
2427
'absent': {

0 commit comments

Comments
 (0)