Fix use of mongo gem after it got installed in this chef run
(cherry picked from commit dbdaf2dd6f8439d62e9dfad5e6b97f97032aba1c)
Cleanup search for mongodb node

We were not checking for the right environment, which might matter.
(cherry picked from commit d06e637c3091f44185c8c00f37e5e8aedbfe28b2)
Restart mongodb on template change
(cherry picked from commit 2dd7c49c30babc8c8eab1d8ad10e24e055b43752)
Cleanup code creating the db connection string

It's important to sort the servers in case of replica set (to avoid the
string changing on every chef run), and it's also important to get the
IP address through the barclamp library (to really have the admin IP
address).
(cherry picked from commit 1b490219370ab5cd01ac139a366da6c5fc8a03ac)
Remove unneeded variable
(cherry picked from commit 37ae5ab031d232101755a7449df925819ec3a266)
Rework setting the replica set attributes on nodes when applying

There were several issues in the old code:
 - using sets of different types (NodeObject and string)
 - unneeded save when there's no change
 - additional save for controller
(cherry picked from commit 7ae3f1f89e7ce43f91152d6654127978ddcfa465)

Conflicts:
	crowbar_framework/app/models/ceilometer_service.rb
Fix configuring MongoDB replica set on first run

We were doing it in the compile phase, while mongodb hadn't started yet.

Also, we're adding a loop to wait for mongodb to be reachable, since
otherwise, we just fail after a 5s timeout.
(cherry picked from commit 532546ea6f9584bab810c3ee85e042ca11c5da40)
Increase timeouts in waits for mongodb

It's taking more than one minute to start here :/
(cherry picked from commit e35c7648764efdb18fcbe19ab6ca6114743eb569)
Wait for a MongoDB master to be available, not just for a MongoDB connection

With a replica set, what matters is that there's one master available.
Otherwise, ceilometer fails to connect to MongoDB.
(cherry picked from commit ccd0fe3315bd445b34332195e42e8ff6bf0e9785)
With HA, really look for mongodb master on all nodes

We were only looking at the current node, unless the current node was
not part of the replica set. That's obviously broken if the current node
is part of the replica set, but not the master.
(cherry picked from commit ff3298d4baaced6df683a61dcdd52256252237df)
Merge pull request #150 from bkutil/ha_backports

Ha backports