1
0
Fork 0

Initial commit

This commit is contained in:
Andrew Tomaka 2013-10-24 09:55:09 -04:00
commit f817b72587
3 changed files with 20 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.ruby-version

View File

@ -0,0 +1,18 @@
require 'securerandom'
module Puppet::Parser::Functions
newfunction(:random_password, :type => :rvalue) do |args|
length = args[0] - 1
store = args[1]
if(args.length != 2)
raise Puppet::ParsError, 'Usage: random_password(length, store)'
end
password = SecureRandom.hex[0..length]
File.open(store, 'w') { |f| f.write(password) }
return password
end
end

1
manifests/init.pp Normal file
View File

@ -0,0 +1 @@
class random_password {}