Issue #3669 has been updated by Andrew Forgue.

I hacked a bit tonight on this for a proof of concept.  It works for me, but I 
haven't done any tests or tried to break it.  I may be going about it the wrong 
way with regard to the indirectors (currently I only modified the REST 
indirector). 

I have a branch on github, 
[here](https://github.com/ajf/puppet/commits/feature%2F2.6.x%2F3669)

It uses `Resolv::DNS` to find SRV records for the host specified as 
`Puppet[:server]` and just blindly overrides `masterport` with the one provided 
in DNS.  if no SRV records are found, it just passes the supplied hostname up 
so it'll check A/CNAME records.  I defaulted to `_puppet._tcp.domain` where 
domain is the domain supplied by facter.   It supports the priority and the 
weighting functionality of the SRV spec.

Here's some output of a sample run:

<pre>
  debug: Loaded state in 0.00 seconds
  debug: Searching for SRV records for _puppet._tcp.bosboot.com
  debug: Found 4 SRV records.
  debug: Yielding next server of puppet1.bosboot.com:8140
  debug: Using cached certificate for ca
  debug: Using cached certificate for centauri.bosboot.com
  debug: Using cached certificate_revocation_list for ca
  debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; 
using pson
  warning: Error connecting to puppet1.bosboot.com:8140: No route to host - 
connect(2)
  debug: Remaining servers: 3
  debug: Yielding next server of puppet3.bosboot.com:8140
  debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; 
using pson
  warning: Error connecting to puppet3.bosboot.com:8140: No route to host - 
connect(2)
  debug: Remaining servers: 2
  debug: Yielding next server of puppet2.bosboot.com:8140
  debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; 
using pson
  warning: Error connecting to puppet2.bosboot.com:8140: No route to host - 
connect(2)
  debug: Remaining servers: 1
  debug: Yielding next server of centauri.bosboot.com:8140
  debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; 
using pson
  info: Caching catalog for centauri.bosboot.com
  debug: Creating default schedules
  debug: Loaded state in 0.00 seconds
  info: Applying configuration version '1292147144'
  debug: Finishing transaction 70221121596680
  debug: Storing state
  debug: Stored state in 0.00 seconds
  notice: Finished catalog run in 0.01 seconds
</pre>

I'll post something to the -dev list tomorrow, but I'm going to bed now.  Any 
comments or input (your code sucks, etc) are appreciated.
----------------------------------------
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