Skip to content

Commit

Permalink
Provide credentials when auth is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpost committed Mar 21, 2024
1 parent 9fc5f68 commit 4b98d53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/puppet/provider/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def self.mongosh_cmd(db, host, cmd)
args.push('--tlsAllowInvalidHostnames') if tls_invalid_hostnames(config)
end

if auth_enabled(config)
args += ['--username', 'admin']
args += ['--password', 'password']
end

args += ['--eval', cmd]
mongosh(args)
end
Expand Down

0 comments on commit 4b98d53

Please sign in to comment.