JioCloud/puppet-rjil — pull request #102 by hkumarmk (2014-10-15 08:39:08+00:00)
Title: Added rjil::openstack_zeromq

NOTE: this has a dependancy on PR #1 of jiocloud/openstack_zeromq.

1. Added rjil::openstack_zeromq class
a. This class accept consul dns names for various openstack services
b. Resolve SRV records for the names given
c. Add /etc/hosts entry for the hostname part of fqdn, so that the hostnames
can be resolved.
d. Call ::openstack_zeromq with an array of hostnames striped from fqdn.

2. Added a function service_discover_dns
This function accept a dns name and return type and return accordingly
Valid return types are:
name: Return array of names
ip: Return array of IPs
both: Return a hash of both names and ip.

3. Added function easy_host
This function accept simple hash value with name and ip and add appropriate
/etc/hosts entry.
Depending on the name it add host alias also (depening on whther the input is
fqdn or just a hostname.

4. Added basic spec tests.

Note: Unit tests to be improved. Currently There are couple of things due to
which I wrote basic tests.
1. Need to see how to mock dns lookup.
2. Need to know how to test parametes for functions being called.
3. While using puppet_spec/compiler, getting error (no such file).
Need to fix that or to use any other method to test easy_host.