Merge pull request #31 from norcams/keyfile_resource_record

Support custom keyfile paths
This commit is contained in:
Nate Riffe 2015-06-12 19:16:45 -05:00
commit b532680b3b
2 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,10 @@ Puppet::Type.newtype(:resource_record) do
defaultto 'update'
end
newparam(:keyfile) do
desc 'Keyfile used to update the record'
end
newparam(:hmac) do
desc 'The HMAC type of the update key'
defaultto 'HMAC-SHA1'

View File

@ -52,6 +52,8 @@ module PuppetBind
file.close
if keyed?
nsupdate('-y', tsig_param, file.path)
elsif keyfile?
nsupdate('-k', kfile, file.path)
else
nsupdate(file.path)
end
@ -106,6 +108,14 @@ module PuppetBind
resource[:keyname]
end
def kfile
resource[:keyfile]
end
def keyfile?
!kfile.nil?
end
def hmac
resource[:hmac]
end