Skip to content

Commit 4812333

Browse files
committed
Only require password when used
If the if in line 39 evaluates to false, the user has been created elsewhere, and we don't actually use (and thus need) password in `postgresql::server::db` class.
1 parent e53ff08 commit 4812333

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: manifests/server/db.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @summary Define for conveniently creating a role, database and assigning the correctpermissions.
22
#
3-
# @param user User to create and assign access to the database upon creation. Mandatory.
4-
# @param password Required Sets the password for the created user.
3+
# @param user User to assign access to the database upon creation (will be created if not defined elsewhere). Mandatory.
4+
# @param password Sets the password for the created user (if a user is created).
55
# @param comment Defines a comment to be stored about the database using the PostgreSQL COMMENT command.
66
# @param dbname Sets the name of the database to be created.
77
# @param encoding Overrides the character set during creation of the database.
@@ -13,7 +13,7 @@
1313
# @param owner Sets a user as the owner of the database.
1414
define postgresql::server::db (
1515
$user,
16-
Variant[String, Sensitive[String]] $password,
16+
Optional[Variant[String, Sensitive[String]]] $password = undef,
1717
$comment = undef,
1818
$dbname = $title,
1919
$encoding = $postgresql::server::encoding,

0 commit comments

Comments
 (0)