Fixed TLSA support and added support for SSHFP record type

This commit is contained in:
Thomas Sturm 2016-01-11 21:42:42 +01:00
parent 27f253354b
commit fbb7e3c7d7
2 changed files with 12 additions and 3 deletions

View File

@ -30,7 +30,7 @@ Puppet::Type.newtype(:resource_record) do
newparam(:type) do newparam(:type) do
desc 'The record type' desc 'The record type'
isrequired isrequired
newvalues 'A', 'AAAA', 'CNAME', 'NS', 'MX', 'SPF', 'SRV', 'NAPTR', 'PTR', 'TXT', 'DS' newvalues 'A', 'AAAA', 'CNAME', 'NS', 'MX', 'SPF', 'SRV', 'NAPTR', 'PTR', 'TXT', 'DS', 'TLSA', 'SSHFP'
end end
newparam(:record) do newparam(:record) do

View File

@ -81,7 +81,7 @@ module PuppetBind
end end
def spaced_type?(type) def spaced_type?(type)
%w(DS TLSA).include?(type) %w(DS TLSA SSHFP).include?(type)
end end
def maybe_quote(type, datum) def maybe_quote(type, datum)
@ -97,7 +97,16 @@ module PuppetBind
end end
def maybe_unspace(type, datum) def maybe_unspace(type, datum)
spaced_type?(type) ? datum.gsub(/^(\d+)\s+(\d+)\s+(\d+)\s+(\w+)\s+(\w+)$/, '\1 \2 \3 \4\5') : datum if spaced_type?(type)
case type
when 'DS', 'TLSA'
datum.gsub(/^(\d+)\s+(\d+)\s+(\d+)\s+(\w+)\s+(\w+)$/, '\1 \2 \3 \4\5')
when 'SSHFP'
datum.gsub(/^(\d+)\s+(\d+)\s+(\w+)\s+(\w+)$/, '\1 \2 \3\4')
end
else
datum
end
end end
def rrdata_adds def rrdata_adds