Support custom keyfile paths

This makes it possible to use resource_record with "standalone"
keyfiles by introducing a keyfile parameter
This commit is contained in:
Jan Ivar Beddari 2015-04-17 13:01:56 +02:00
parent eb6d3f5d63
commit 53d60fe8a7
2 changed files with 14 additions and 0 deletions

View File

@ -42,6 +42,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

@ -51,6 +51,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
@ -81,6 +83,14 @@ module PuppetBind
resource[:keyname]
end
def kfile
resource[:keyfile]
end
def keyfile?
!kfile.nil?
end
def hmac
resource[:hmac]
end