diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-02-03 14:11:18 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-02-03 14:11:18 -0200 |
commit | adc9c0f1168b780e6c8b78f63caa2fb51cc72399 (patch) | |
tree | 8b431784fd610e203ca3b42f03069f1c617dcddd /lib/puppet/parser | |
parent | b5d91bdba1f0a02614fd6f6e9699c2c97ec8b725 (diff) | |
download | puppet-mysql-adc9c0f1168b780e6c8b78f63caa2fb51cc72399.tar.gz puppet-mysql-adc9c0f1168b780e6c8b78f63caa2fb51cc72399.tar.bz2 |
Adding resource types mysql_{user,database,grant} (2)
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/functions/mysql_password.rb | 9 |
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 + |