edelight/chef-mongodb — pull request #344 by ceejh (2014-10-09 16:06:12+00:00)
Title: User management in replicasets / sharding

The goal of this PR is to fix the inability to create users in a sharded / replicaset cluster. The main problems were:

1. It was basing whether to authenticate with the node / create the admin user based on `node[mongodb][config][auth] = true`. However, `auth=true` is not a valid ini setting for mongos instances, so mongos would fail to start. (Solved this by creating a separate variable called `mongos_create_admin` which should be set to `true` on mongos instances.)
2. The mongo ruby driver would fail to connect to mongo while it was in the process of configuring the nodes for replicaset and sharding. According to the [FAQ](https://github.com/mongodb/mongo-ruby-driver/wiki/FAQ#i-periodically-see-connection-failures-between-the-driver-and-mongodb-why-cant-the-driver-retry-the-operation-automatically), reconnections are not handled by the driver, and should be handled solely by the application. (Solved by adding in retires, similar to ones that already existed in the `libraries` file.)

This PR also includes the separation of `[admin][user/pass]` and `[authentication][user/pass]` so that users should be able to change the administrator password of existing administrators.

Issues: #333, #327, #326