From 16b06320cd3bb3121446717c05b6bc13ae2ff133 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 27 Jul 2011 18:41:27 +0200 Subject: init of trocla module --- lib/puppet/parser/functions/trocla.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lib/puppet/parser/functions/trocla.rb (limited to 'lib/puppet/parser/functions/trocla.rb') 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 -- cgit v1.2.3 From 20fdb3bcc7201bc86cfbddc269fe807a8e418963 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 3 Aug 2011 19:25:06 +0200 Subject: update doc --- lib/puppet/parser/functions/trocla.rb | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'lib/puppet/parser/functions/trocla.rb') diff --git a/lib/puppet/parser/functions/trocla.rb b/lib/puppet/parser/functions/trocla.rb index 9fa06bb..487d1fd 100644 --- a/lib/puppet/parser/functions/trocla.rb +++ b/lib/puppet/parser/functions/trocla.rb @@ -1,7 +1,29 @@ module Puppet::Parser::Functions - newfunction(:trocla, :type => :rvalue) do |*args| + newfunction(:trocla, :type => :rvalue, :doc => " +This will create or get a random password from the trocla storage. + +Usage: + + $password_user1 = trocla(key,[format='plain'[,options={}]]) + +Means: + + $password_user1 = trocla('user1') + +Create or get the plain text password for the key 'user1' + + $password_user2 = trocla('user2','mysql') + +Create or get the mysql style sha1 hashed password. + + $options_user3 = { 'username' => 'user3' } # Due to a puppet bug + # this needs to be assigned + # like that. + $password_user3 = trocla('user3','pgsql', $options_user3) + " + ) do |*args| require File.dirname(__FILE__) + '/../../util/trocla_helper' Puppet::Util::TroclaHelper.trocla(:password,true,*args) end -end \ No newline at end of file +end -- cgit v1.2.3 From 64205c93a957bafdfb255a991844f2d7744f11b5 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 6 Sep 2011 15:02:51 +0200 Subject: as setting a hash first is a bit cumbersome, we provide the possibility to pass a yaml string --- lib/puppet/parser/functions/trocla.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/puppet/parser/functions/trocla.rb') diff --git a/lib/puppet/parser/functions/trocla.rb b/lib/puppet/parser/functions/trocla.rb index 487d1fd..e042872 100644 --- a/lib/puppet/parser/functions/trocla.rb +++ b/lib/puppet/parser/functions/trocla.rb @@ -20,6 +20,10 @@ Create or get the mysql style sha1 hashed password. # this needs to be assigned # like that. $password_user3 = trocla('user3','pgsql', $options_user3) + +Options can also be passed as a yaml string: + + $password_user3 = trocla('user3','pgsql', \"username: 'user3'\") " ) do |*args| require File.dirname(__FILE__) + '/../../util/trocla_helper' -- cgit v1.2.3 From 70b87a890319b262641503e78495b83df24f20ea Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 7 Jun 2016 21:59:18 +0200 Subject: whitespace cleanup --- lib/puppet/parser/functions/trocla.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser/functions/trocla.rb') diff --git a/lib/puppet/parser/functions/trocla.rb b/lib/puppet/parser/functions/trocla.rb index e042872..b1a7b61 100644 --- a/lib/puppet/parser/functions/trocla.rb +++ b/lib/puppet/parser/functions/trocla.rb @@ -27,7 +27,7 @@ Options can also be passed as a yaml string: " ) do |*args| require File.dirname(__FILE__) + '/../../util/trocla_helper' - + Puppet::Util::TroclaHelper.trocla(:password,true,*args) end end -- cgit v1.2.3