On Tue, Dec 14, 2010 at 14:33, Andrew J. Forgue <[email protected]> wrote:
> This patch gives Puppet the ability to find a puppet master via SRV
> records in DNS. First Puppet will try to resolve the server parameter
> in puppet.conf (or supplied on command line) to an SRV record before
> treating it as a regular host. This patch basically adds client-side
> load-balancing.
This looks good; I like the addition of the facility.
> diff --git a/lib/puppet/network/resolver.rb b/lib/puppet/network/resolver.rb
> new file mode 100644
> index 0000000..9165efb
> --- /dev/null
> +++ b/lib/puppet/network/resolver.rb
[...]
> + Puppet.debug "Searching for SRV records for #{hostname}"
> + rrs = resolver.getresources(hostname, Resolv::DNS::Resource::IN::SRV)
Doesn't this resolve the label 'example.com', where you wanted
'_puppet._tcp.example.com'?
> + # Find a list of priorities, try everything in the priority first
> + # and then move to the next priority, would really like to have used
> + # Array#group_by here, but puppet supports 1.8.1
> + priorities = rrs.map { |record| record.priority }.sort.uniq
I would probably have open-coded group_by here, but your work seems
sound to me. I just think the rest of the algorithm would be much
clearer (as, I think, do you) and justify the messing around with
writing group_by. :)
Regards,
Daniel
--
✣ Daniel Pittman ✉ [email protected] ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.