From adc9c0f1168b780e6c8b78f63caa2fb51cc72399 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 3 Feb 2010 14:11:18 -0200 Subject: Adding resource types mysql_{user,database,grant} (2) --- lib/puppet/parser/functions/mysql_password.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/puppet/parser/functions/mysql_password.rb (limited to 'lib/puppet/parser/functions') 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 + -- cgit v1.2.3