Open jelder opened 12 years ago
+1
+1 does anyone have a good solution to this yet?
I'm sorry for the delay. The cause of this is somewhere deep inside the 190 lines of Mongodb.configure_replicaset. The original authors have no longer contribute to this cookbook, and I'm usually too feeble minded to grok all that, so I shy away from these tickets in fear.
I can see that your issue is coming from line 47, but I don't really know much about this library.
Oh, it looks like our Mongo::Connection is being deprecated in favor of Mongo::Client. joy.
Looks like we're going to need to #add_auth
to the connection.
oh joy, we also set up multiple connections.
I haven't added this to #221 yet, but I'll just leave this comment to remind me that this ticket is related.
For me, I've been dropping an auth command after connection strings, like: https://github.com/edelight/chef-mongodb/blob/master/libraries/mongodb.rb#L42
Mine looks along the lines of:
if node[:mongodb][:config][:auth] connection["admin"].authenticate(mongo_bag["admin"]["username"], mongo_bag["admin"]["password"]) end
mongo_bag is simply an encrypted databag im storing credentials in. This has been working pretty well for me in all of my replicasets.
Replica set configuration fails when auth is enabled.