On May 3, 2:53 pm, Ryan Bowlby <rbowlb...@gmail.com> wrote: > My apologies on terminology and thank you for the list of best > options. My problem is this, I want to have this os::motd::register > defined type exist in the main class of every module. Yet I don't want > to force a host to have to include os::motd. I want it as an option. > The fact that I don't want to include os::motd on each node means all > three options don't work. > > I'm starting to think using the os::motd::register defined type in > every module is not the way to go. Perhaps using exported resources is > a more flexible method of achieving this?
Hmm. I guess I misunderstood your objective. It is still true that 'defined' is not a good approach, however, and also that os::motd::register is a bit rude to not take care of declaring its dependencies itself. It might work to declare all your os::motd::register instances virtually, right where they now are, and then collect them at the end of each node definition. I suspect, though, that you would end up with the same problem you already have. Generally, I recommend replacing "is foo defined?" conditions with "is foo *supposed to be* defined?". The latter can be evaluated based on global or class variables, or (better) external data. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.