Use tsig parameter for dig, too.

Add the tsig_param when invoking dig using the -y command line option. This
allows dig and nsupdate to operate in the same view when views are matched by
tsig signature.
This commit is contained in:
Nate Riffe 2014-09-05 09:45:15 -05:00
parent 7606a2092b
commit 02db5f35a2
2 changed files with 7 additions and 2 deletions

View File

@ -107,7 +107,12 @@ private
def query
unless @query
@query = dig("@#{server}", '+noall', '+answer', name, type, '-c', rrclass).lines.map do |line|
if keyed?
dig_text = dig("@#{server}", '+noall', '+answer', name, type, '-c', rrclass, '-y', tsig_param)
else
dig_text = dig("@#{server}", '+noall', '+answer', name, type, '-c', rrclass)
end
@query = dig_text.lines.map do |line|
linearray = line.chomp.split(/\s+/, 5)
{
:name => linearray[0],

View File

@ -7,7 +7,7 @@ Puppet::Type.newtype(:dns_rr) do
desc "Class/Type/Name for the resource record"
validate do |value|
if (value =~ /^([A-Z]+)\/([A-Z]+)\/[a-zA-Z0-9.-]+$/)
if (value =~ /^([A-Z]+)\/([A-Z]+)\/[a-zA-Z0-9._-]+$/)
rrclass = $1
if ( !%w(IN CH HS).include? rrclass )
raise ArgumentError, "Invalid resource record class: %s" % rrdata