summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-07-27 18:41:27 +0200
committermh <mh@immerda.ch>2011-07-27 18:41:27 +0200
commit16b06320cd3bb3121446717c05b6bc13ae2ff133 (patch)
treee2680d36bc4282d85e97fc294b0942367273dbde /lib/puppet/parser/functions
init of trocla module
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/trocla.rb7
-rw-r--r--lib/puppet/parser/functions/trocla_get.rb9
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/trocla.rb b/lib/puppet/parser/functions/trocla.rb
new file mode 100644
index 0000000..9fa06bb
--- /dev/null
+++ b/lib/puppet/parser/functions/trocla.rb
@@ -0,0 +1,7 @@
+module Puppet::Parser::Functions
+ newfunction(:trocla, :type => :rvalue) do |*args|
+ require File.dirname(__FILE__) + '/../../util/trocla_helper'
+
+ Puppet::Util::TroclaHelper.trocla(:password,true,*args)
+ end
+end \ No newline at end of file
diff --git a/lib/puppet/parser/functions/trocla_get.rb b/lib/puppet/parser/functions/trocla_get.rb
new file mode 100644
index 0000000..ed8eeab
--- /dev/null
+++ b/lib/puppet/parser/functions/trocla_get.rb
@@ -0,0 +1,9 @@
+module Puppet::Parser::Functions
+ newfunction(:trocla_get, :type => :rvalue) 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