diff --git a/lib/puppet/type/resource_record.rb b/lib/puppet/type/resource_record.rb index db9c1f6..fe12d06 100644 --- a/lib/puppet/type/resource_record.rb +++ b/lib/puppet/type/resource_record.rb @@ -30,7 +30,7 @@ Puppet::Type.newtype(:resource_record) do newparam(:type) do desc 'The record type' 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 newparam(:record) do diff --git a/lib/puppet_bind/provider/nsupdate.rb b/lib/puppet_bind/provider/nsupdate.rb index 2d4b884..7aad48e 100644 --- a/lib/puppet_bind/provider/nsupdate.rb +++ b/lib/puppet_bind/provider/nsupdate.rb @@ -81,7 +81,7 @@ module PuppetBind end def spaced_type?(type) - %w(DS TLSA).include?(type) + %w(DS TLSA SSHFP).include?(type) end def maybe_quote(type, datum) @@ -97,7 +97,16 @@ module PuppetBind end 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 def rrdata_adds