From 61c653aac054999d26b1f1cda64e87e05bee03cb Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 25 Oct 2008 20:31:44 +0000 Subject: added a generate password function --- plugins/puppet/parser/functions/mkpassword.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/puppet/parser/functions/mkpassword.rb (limited to 'plugins/puppet/parser/functions') diff --git a/plugins/puppet/parser/functions/mkpassword.rb b/plugins/puppet/parser/functions/mkpassword.rb new file mode 100644 index 0000000..c7ba8c0 --- /dev/null +++ b/plugins/puppet/parser/functions/mkpassword.rb @@ -0,0 +1,7 @@ +## mkpasswd("password", "12345678") +## needs an 8-char salt *always* +module Puppet::Parser::Functions + newfunction(:mkpasswd, :type => :rvalue) do |args| + %x{/usr/bin/mkpasswd -H MD5 #{args[0]} #{args[1]}}.chomp + end +end -- cgit v1.2.3