summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-10-31 15:16:40 +0100
committermh <mh@immerda.ch>2009-10-31 15:16:40 +0100
commit304b199b700f130925c09c330a63fc6c4745321b (patch)
tree427b3f2febd501dfbec48b3e02a5483608c685db /lib/puppet/parser/functions
parent62e9001ab2288b66ee0f84ac50a789301f658485 (diff)
move plugin directory to fit new 0.25 style
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/mysql_password.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/mysql_password.rb b/lib/puppet/parser/functions/mysql_password.rb
new file mode 100644
index 0000000..6443d95
--- /dev/null
+++ b/lib/puppet/parser/functions/mysql_password.rb
@@ -0,0 +1,9 @@
+# hash a string as mysql's "PASSWORD()" function would do it
+require 'digest/sha1'
+
+module Puppet::Parser::Functions
+ newfunction(:mysql_password, :type => :rvalue) do |args|
+ '*' + Digest::SHA1.hexdigest(Digest::SHA1.digest(args[0])).upcase
+ end
+end
+