openshift/openshift-extras — pull request #52 by Miciah (2013-09-25 20:26:24+00:00)
Title: openshift.ks: Add CONF_DATASTORE_REPLICANTS

Add the CONF_DATASTORE_REPLICANTS setting, which specifies
a comma-separated list of hostnames that will be configured to constitute
a MongoDB replica set. This setting defaults to the value of
CONF_DATASTORE_REPLICANTS.

If the number of replicants is 1 (which is the case with the default
value), then replication is not configured.

Add the CONF_MONGODB_KEY setting, which specifies the key that will be used
by replicants. This setting defaults to 'OSEnterprise'.

Add the CONF_MONGODB_REPLSET setting, which specifies the name of the
replica set. This setting defaults to 'ose'.

Factor the new execute_mongodb function out of configure_datastore.

Factor the new configure_datastore_add_users function out of
configure_datastore.

Add the configure_datastore_add_replicants function, which can be
invoked as an action on the host that is to be the primary. Note that we
cannot perform this step during the initial installation because it will
fail if not all hosts in the replica set are up and running mongod.

Factor the new set_mongodb function out of configure_datastore.

Modify configure_datastore to configure user accounts only for
a non-replicated setup and otherwise to configure appropriate settings
(rest, journal, replSet, and keyFile) for a replicated setup and to
write out mongodb.key.

Modify configure_controller to set MONGO_HOST_PORT to the entire replica
set.

Modify set_defaults to accommodate the new settings and to append the port
specification :27017 to each hostname in the replica set that does not
already have a port specification.