Merge pull request #31 from norcams/keyfile_resource_record
Support custom keyfile paths
This commit is contained in:
commit
b532680b3b
@ -48,6 +48,10 @@ Puppet::Type.newtype(:resource_record) do
|
|||||||
defaultto 'update'
|
defaultto 'update'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
newparam(:keyfile) do
|
||||||
|
desc 'Keyfile used to update the record'
|
||||||
|
end
|
||||||
|
|
||||||
newparam(:hmac) do
|
newparam(:hmac) do
|
||||||
desc 'The HMAC type of the update key'
|
desc 'The HMAC type of the update key'
|
||||||
defaultto 'HMAC-SHA1'
|
defaultto 'HMAC-SHA1'
|
||||||
|
|||||||
@ -52,6 +52,8 @@ module PuppetBind
|
|||||||
file.close
|
file.close
|
||||||
if keyed?
|
if keyed?
|
||||||
nsupdate('-y', tsig_param, file.path)
|
nsupdate('-y', tsig_param, file.path)
|
||||||
|
elsif keyfile?
|
||||||
|
nsupdate('-k', kfile, file.path)
|
||||||
else
|
else
|
||||||
nsupdate(file.path)
|
nsupdate(file.path)
|
||||||
end
|
end
|
||||||
@ -106,6 +108,14 @@ module PuppetBind
|
|||||||
resource[:keyname]
|
resource[:keyname]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def kfile
|
||||||
|
resource[:keyfile]
|
||||||
|
end
|
||||||
|
|
||||||
|
def keyfile?
|
||||||
|
!kfile.nil?
|
||||||
|
end
|
||||||
|
|
||||||
def hmac
|
def hmac
|
||||||
resource[:hmac]
|
resource[:hmac]
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user