On Tuesday, April 16, 2013 4:19:26 AM UTC-5, Brent wrote:
>
> Good day 
>
> Im using puppet 2.7.18 and hiera 1.1.0. 
>
> I would like to ask. 
>
> For some servers I manage I use the following to pull in 'custom classes'. 
> hiera_include('classes') 
>
> And it all works very well. 
>
> But Im now have a class that I now need to class via hiera, and pass 
> arguments too (the argument, really is where the clients DKIM keys 
> reside). 
>
> Can I have puppet / hiera call a parametrised class from hieras yaml file. 
>
>
In Puppet3, there is databindings, which will do auto-lookups in hiera for 
all class params.

Only way to get this behaviour in 2.7.x is to setup the params to invoke 
hiera, such as:

class myklass(
  $param1 = hiera('myklass::param1', 'somedefault'),
  $param2 = hiera('myklass::param2', 'othervalue'),
...

The "myklass::param1" naming setup for the hiera key value is not strictly 
needed, but it is how it will be expected to be in puppet3 for 
databindings, so I would recommend that you use that naming style now, to 
ease upgrades later.

 

> Thanks 
> Brent Clark 
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to