Give bind::key the ability to generate keys

Also, allow them to be placed elsewhere in the filesystem and make it possible
to exclude a key from the named configuration.
This commit is contained in:
Nate Riffe
2015-01-18 10:11:24 -06:00
parent a981de576e
commit 9b1cbacee0
3 changed files with 41 additions and 10 deletions
@@ -0,0 +1,9 @@
# ex: syntax=ruby si sw=2 ts=2 et
require 'securerandom'
module Puppet::Parser::Functions
newfunction(:hmac_secret, :type => :rvalue) do |args|
bits = args[0].to_i
SecureRandom.base64(bits / 8)
end
end