Skip to content

Commit 4b98d53

Browse files
committed
Provide credentials when auth is enabled
1 parent 9fc5f68 commit 4b98d53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/puppet/provider/mongodb.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ def self.mongosh_cmd(db, host, cmd)
9797
args.push('--tlsAllowInvalidHostnames') if tls_invalid_hostnames(config)
9898
end
9999

100+
if auth_enabled(config)
101+
args += ['--username', 'admin']
102+
args += ['--password', 'password']
103+
end
104+
100105
args += ['--eval', cmd]
101106
mongosh(args)
102107
end

0 commit comments

Comments
 (0)