The puppetlabs-stdlib module includes a getparam function that you can use
to retrieve a resource parameter if you know the resource type, name and
parameter you want to retrieve(which may fit your use case, I'm a little
unclear).  You can see it here:
https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/parser/functions/getparam.rb

If you want more than that, you'd have to write a custom function.  I'm
actually working on a set of functions/types to bucket arbitrary data and
then retrieve it in array form for a couple of my own internal use cases -
I wouldn't use it yet:  but you can see what I have so far here -
https://github.com/TERC/puppet-databucket

Hope that helped,
--Nick



On Wed, Sep 18, 2013 at 7:03 AM, Roman <str...@gmail.com> wrote:

> Hi everyone,
>
> i am currently trying to reduce some redundancy in my puppet-setup. I have
> setup user-account using virtual-resources like this:
>
> @users::account { 'xyz':
> uid => '1000',
> ...
> key => 'AAAsfhjujbh...'
> }
>
> Now i have written another simple module to setup mercurial-repositories
> with hgssh3 access-protection which uses the same 'key' as above, but i
> have to specify the key a 2nd time for the hgssh3-class:
>
> class hgssh3 ( $users=['',''] ) {
>       "/home/$name/.ssh/authorized_keys":
>         ensure => file,
>         replace => false,
>         mode   => 600,
>         content => template('hgssh3/authorized_keys.erb');
> ...
> }
>
> I was thinking i could somehow use the key-variable from the first class
> in a the template of hgssh3 and just specify the user who should get
> access? Is this at all possible?
>
> Thanks for every little hint or link ;)
>
> best regards,
> Roman
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to