JioCloud/puppet-rjil — pull request #93 by hkumarmk (2014-10-09 11:22:37+00:00)
Title: Added autodiscovery using consul for ceph nodes

NOTE: This PR depends on PR #3 in jiocloud/puppet-ceph.

Here is the flow

1. stmonleader1 (Only one in the role stmonleader), initialize itself as ceph
mon and register itself to consul as "stmon" service
2. All other ceph servers and clients (All st, stmon, cp, oc roles) will wait
for at least one node with active "stmon" service in consul before they
initialize.
3. After the storage cluster initialization, both stmon and stmonleader will
serve the same purpose.

Here are the internals and changes.

* rjil::ceph will not add ceph mon configuration details now - this has been
moved as different defines.
* rjil::ceph::mon::mon_config will add mon configuration only for ceph mons.
It get stmon service IPs from consul and configure them.
* It add its own mon configuration with mon_name and id as its hostname and
mon_addr with its IP address of private interface. The reason why this is
required is that ceph init script only start that mon configuration which match
the node's hostname and mon_addr must be in form of IPaddress:port - a name even
which resolves to IP will not work.
* It add rest of the mon configuration just with IP address got from consul as
both mon_name, id and mon_addr.
* rjil::ceph::mon_config will add mon configuration for all ceph osds and ceph
clients. It stmon service IPs from consul and configure them as both mon_name,
id and mon_addr.
* dns_resolve is a custom function to do dns forward lookup and return IP list.
* ceph mon test script is added which will be used as check_script for stmon
consul service
* Ceph mon test script need root access, so added the user "consul" sudoers.
* Added service blocker for st and stmon roles to make sure they wait for at
least one stmon node (stmonleader) is up before they start.
* Added appropriate node definition in cloud.vagrantlxc.yaml.
* Added spec tests.