summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/trocla_get.rb
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-08-03 19:25:06 +0200
committermh <mh@immerda.ch>2011-08-03 19:25:06 +0200
commit20fdb3bcc7201bc86cfbddc269fe807a8e418963 (patch)
tree904a04d30422d7a224044846cc2f362e7c7f754a /lib/puppet/parser/functions/trocla_get.rb
parent7374cf944fbc1b52c438ce7e5345f94427ea876e (diff)
update doc
Diffstat (limited to 'lib/puppet/parser/functions/trocla_get.rb')
-rw-r--r--lib/puppet/parser/functions/trocla_get.rb23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/trocla_get.rb b/lib/puppet/parser/functions/trocla_get.rb
index ed8eeab..01c4e01 100644
--- a/lib/puppet/parser/functions/trocla_get.rb
+++ b/lib/puppet/parser/functions/trocla_get.rb
@@ -1,9 +1,28 @@
module Puppet::Parser::Functions
- newfunction(:trocla_get, :type => :rvalue) do |*args|
+ newfunction(:trocla_get, :type => :rvalue, :doc => "
+ This will only get an already stored password from the trocla storage.
+
+Usage:
+
+ $password_user1 = trocla_get(key,[format='plain'])
+
+Means:
+
+ $password_user1 = trocla('user1')
+
+Get the plain text password for the key 'user1'
+
+ $password_user2 = trocla_get('user2','mysql')
+
+Get the mysql style sha1 hashed password.
+
+It will raise a parse error if the password haven't yet been stored in trocla.
+"
+ ) do |*args|
require File.dirname(__FILE__) + '/../../util/trocla_helper'
if (answer=Puppet::Util::TroclaHelper.trocla(:get_password,false,*args)).nil?
raise(Puppet::ParseError, "No password for key,format #{args.flatten.inspect} found!")
end
answer
end
-end \ No newline at end of file
+end