Issue #3669 has been updated by Andrew Forgue.

I messed with it some more and made the file resource type able to use SRV 
records.  I also wrote some spec tests for it.

Here's how it works, it modifies the REST indirector and the file resource type 
to resolve the host via a new `Puppet::Network::Resolver` class.  This class 
does a DNS query for SRV record types.  If it finds none, it just returns the 
hostname and port specified for other libraries to resolve the A record.  
Otherwise, it will yield a list of hostnames, ports and the number of hosts 
remaining (to decide whether or not to hard fail), the basic way to connect to 
a host is:

<pre>
Puppet::Network::Resolver.servers(hostname, port) do |server, port, remaining|
  begin
    .. connect to host ..
  rescue SystemCallError => e
    # We only want to catch things like connection refused, no route to host, 
etc.

    # Re-raise the last exception if there are no more hosts
    raise unless remaining > 0 
  end
end
</pre>

Some questions about the behavior that I have and need input for:

1. Should the client 'stick' to the first successful servicer of the SRV record 
or should it find a new one for every request?
1. The default host should be `_puppet._tcp.$domain`, is this acceptable?  It's 
what the RFC seems to say.  I didn't actually change the default.
1. Is my weighting method accurate?
1. Is there anything that connects somewhere else besides the rest indirector 
and file type that should use SRV records?

I haven't modified any configuration variables since I would think that the 
host used in the server configuration variable can be either an A record or a 
SRV record with SRV records taking precedence since if you have them, you 
obviously set them up on purpose.  I'll try this in my environment this week 
before submitting the patch to -dev, but for now you can get it from my github 
branch: https://github.com/ajf/puppet/commits/feature%2F2.6.x%2F3669


----------------------------------------
Feature #3669: Make puppet honor DNS SRV records
https://projects.puppetlabs.com/issues/3669

Author: Martin Marcher
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: Statler
Affected Puppet version: development
Keywords: 
Branch: 


I'd like to be able to define where puppet looks for the master server.

I propose the following:

By default try in the following order:

1. Look for a "_x-puppet._tcp.example.com" SRV record (or any name that you 
think is appropriate, but keep it a SRV record)
2. For backwards compatibility, if no SRV record is present look for 
puppet.example.com as a fallback or any value that is configured in the puppet 
config file

Reasoning:

A System Administrator can easily spread out the load over multiple puppet 
servers in this way or define some split horizon which answers with the 
"correct" hostname to use as a puppet master.

Thanks,
Martin


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to