Skip to content

Commit 28d71fd

Browse files
authored
Merge pull request #772 from dermsd/fix-role-regex
fix regex to allow database names to contain "-" in role@db syntax
2 parents 44b0e62 + 4310273 commit 28d71fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ The password hash of the user. Use mongodb_password() for creating hash. Only av
19441944

19451945
##### `roles`
19461946

1947-
Valid values: `%r{^\w+(@\w+)?$}`
1947+
Valid values: `%r{^\w+(@[\w-]+)?$}`
19481948

19491949
The user's roles.
19501950

lib/puppet/type/mongodb_user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def initialize(*args)
4242
newproperty(:roles, array_matching: :all) do
4343
desc "The user's roles."
4444
defaultto ['dbAdmin']
45-
newvalue(%r{^\w+(@\w+)?$})
45+
newvalue(%r{^\w+(@[\w-]+)?$})
4646

4747
# Pretty output for arrays.
4848
def should_to_s(value)

0 commit comments

Comments
 (0)