On Sunday, August 16, 2015 at 5:59:39 PM UTC-5, puppeteer123 wrote:
>
> Is it posible to generate a subclass from a value in hiera?
>
> i.e.
>
>
> class yum (
> $subclass_name = undef,
> ) {
> class yum::repo::$subclass_name
>
>
> I want to be able to create yumrepos individually without having to
> generate a template file for each one.
>
> Idea is:
>
> include yum::repo::epel
> include yum::repo::kernel
>
> I haven't tested this, but wanted to see if anyone has tried this, if it
> will work, and any implications.
>
You should be able to interpolate Hiera data to form a class name, which
you then use with the include() function or in the title of a resource-like
class declaration.
However, you should not plan on a class parameterized with a single
repository name. Because each class can be declared at most once, that
route limits you to declaring only one repository.
John
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/4147fc88-94c5-430a-b00d-48d5853f8e24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.