Class: Puppet::HTTP::Resolver::SRV
- Inherits:
-
Puppet::HTTP::Resolver
- Object
- Puppet::HTTP::Resolver
- Puppet::HTTP::Resolver::SRV
- Defined in:
- lib/puppet/http/resolver/srv.rb
Overview
Resolve a service using DNS SRV records.
Instance Method Summary collapse
-
#initialize(client, domain:, dns: Resolv::DNS.new) ⇒ SRV
constructor
Create an DNS SRV resolver.
-
#resolve(session, name, ssl_context: nil, canceled_handler: nil) ⇒ Puppet::HTTP::Service
Walk the available srv records and return the first that successfully connects.
Methods inherited from Puppet::HTTP::Resolver
Constructor Details
Instance Method Details
#resolve(session, name, ssl_context: nil, canceled_handler: nil) ⇒ Puppet::HTTP::Service
Walk the available srv records and return the first that successfully connects
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/puppet/http/resolver/srv.rb', line 31 def resolve(session, name, ssl_context: nil, canceled_handler: nil) # Here we pass our HTTP service name as the DNS SRV service name # This is fine for :ca, but note that :puppet and :file are handled # specially in `each_srv_record`. @delegate.each_srv_record(@srv_domain, name) do |server, port| service = Puppet::HTTP::Service.create_service(@client, session, name, server, port) return service if check_connection?(session, service, ssl_context: ssl_context) end nil end |