puppet-bind/lib/puppet/parser/functions/hmac_secret.rb
Nate Riffe 9b1cbacee0 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.
2015-01-18 10:11:24 -06:00

10 lines
215 B
Ruby

# 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