-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user management ability #313
Conversation
…cipe, readme updates, kitchen integration tests
…idden, and is concat'd onto users array if auth is true updating read me and kitchen.yml for more instructions
adding the ability to add admin and other users to mongodb through recip...
# this will fail on the first attempt, but user will still be created | ||
# because of the localhost exception | ||
begin | ||
admin.authenticate(node[:mongodb][:admin][:username], node[:mongodb][:admin][:password]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work with multiple mongos on the same box (I know nothing does, but I'd like to avoid having to change this later). Same goes for the retrieve_db
's access of node[:mongodb][:host]
.
Perhaps a connection object like in opscode's database
cookbook?
looks awesome! If it's easy to extract out a connection object (preferably with the same defaults you provide), I'd love it. but it lgtm regardless. |
… default to pass config
adding connection hash to resource, using it in provider and changing de...
I've updated the code to factor out the connection object. Let me know if there are any problems with it. |
|
||
# If authentication is required, | ||
# add the admin to the users array for adding/updating | ||
users = [admin] if node['mongodb']['config']['auth'] == true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users
is undefined if node['mongodb']['config']['auth'] != true
this'll make the concat
have a bad time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, should now be fixed.
@ceejh definitely the right track! Let me know when you're comfortable with it and I'll run a full kitchen pass against it. Docs, tests, resources, works with multitenancy, this is quite the patch! |
Should be good to go unless you see any more problems. |
@@ -0,0 +1,10 @@ | |||
default['mongodb']['config']['auth'] = true | |||
|
|||
default[:mongodb][:admin] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'
instead of :
also goes for the arrays.
other than the style nitpick LGTM |
Updated the keys to use |
Let me know if there's anything else that needs to be done to get this merged. |
install_method: mongodb-org | ||
# Needed to read the correct config file | ||
# since mongo 2.6 | ||
default_init_name: mongod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢 We'll fix #262 soon.
Add user management ability
This PR adds the following:
Should take care of #225