OK. Lets try it like this: <whatever>.pp ------------------------- class main_class_foo::subclass_one ( $parameter_one_a, $parameter_one_b ) { ... }
class main_class_foo::subclass_two ( $parameter_two_a, $parameter_two_b ) { ... } ------------------------- <whatever>.yaml ------------------------- main_class_foo: subclass_one: parameter_one_a: this parameter_one_b: that subclass_two: parameter_two_a: other parameter_two_b: whatever ------------------------- <another-whatever>.pp ------------------------- $main_class_stuff = hiera_hash ( 'main_class_foo' ) create resources (main_class_foo, $main_class_stuff ) Main_class_foo <| |> ------------------------- Or do I need to do it like this: Same <whatever>.pp <whatever>.yaml ------------------------- main_class_foo::subclass_one: parameter_one_a: this parameter_one_b: that main_class_foo::subclass_two: parameter_two_a: other parameter_two_b: whatever ------------------------- <another-whatever>.pp ------------------------- $main_class_one_stuff = hiera_hash ( 'main_class_foo::subclass_one’ ) create resources (main_class_foo::subclass_one, $main_class_one_stuff ) $main_class_two_stuff = hiera_hash ( 'main_class_foo::subclass_two' ) create resources (main_class_foo::subclass_two, $main_class_two_stuff ) Main_class_foo::Subclass_one <| |> Main_class_foo::Subclass_two <| |> ------------------------- On Feb 11, 2013, at 5:00 PM, Ellison Marks wrote: > I don't see your spaceship, but that aside, I believe that your create > resources call will try to instantiate two main_class_foo classes, named > subclass_one and subclass_two, with the listed parameters. I don't think you > can use create_resources to instantiate different kinds of classes. > > On Monday, February 11, 2013 11:41:33 AM UTC-8, Ygor wrote: > OK, I have a collection of related classes -- > > main_class_foo::subclass_one > main_class_foo::subclass_two > ... etc > > And each subclass has parameters, > > class main_class_foo::subclass_one ( $parameter_one_a, $parameter_one_b ) { > ... } > class main_class_foo::subclass_two ( $parameter_two_a, $parameter_two_b ) { > ... } > > > so can I make a hiera file like this: > > > main_class_foo: > subclass_one: > parameter_one_a: this > parameter_one_b: that > subclass_two: > parameter_two_a: other > parameter_two_b: whatever > > ...and then load it with create_resources and instantiate it with an empty > spaceship operator like this: > > $main_class_stuff = hiera_hash ( 'main_class_foo' ) > create resources (main_class_foo, $main_class_stuff ) > > Is that correct ? > > “Sometimes I think the surest sign that intelligent life exists elsewhere in > the universe is that none of it has tried to contact us.” > Bill Waterson (Calvin & Hobbes) > > > -- > 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. > > -- 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.