summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-12-05 14:42:12 +0000
committermh <mh@immerda.ch>2008-12-05 14:42:12 +0000
commitb690f927b3cb8d24c0ef514a989e47ee112eb0b9 (patch)
tree0d1bbfd2dca8b570a0c8fb4cf4b816a9626c725b /plugins
parent05465fa92dcd47a09c86d9bf2f47deb13543f4be (diff)
merged with puzzle
Diffstat (limited to 'plugins')
-rw-r--r--plugins/puppet/parser/functions/htpasswd_sha1.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/puppet/parser/functions/htpasswd_sha1.rb b/plugins/puppet/parser/functions/htpasswd_sha1.rb
new file mode 100644
index 0000000..937621d
--- /dev/null
+++ b/plugins/puppet/parser/functions/htpasswd_sha1.rb
@@ -0,0 +1,8 @@
+require 'digest/sha1'
+require 'base64'
+
+module Puppet::Parser::Functions
+ newfunction(:htpasswd_sha1, :type => :rvalue) do |args|
+ "{SHA}" + Base64.encode64(Digest::SHA1.digest(args[0]))
+ end
+end