On Feb 14, 2008, at 6:23 AM, Peter Hoeg wrote:
> Guys,
>
> hope you don''t mind the flood of questions, but I''m sure
others are in
> a similar situation and might benefit from knowing.
>
> I have "baseclass" that all classes inherit from. It''s
quite tempting
> to place all common utility functions in there.
>
> Example, this is my current baseclass:
>
> class baseclass {
> case $is_using_runit {
> true: { Service { provider => runit } }
> false: { Service { provider => debian } }
> }
> exec { "reload_apt":
> command => "apt-get update",
> refreshonly => true;
> }
> }
>
> But is this the right place to put the "reload_apt" exec
statement or
> would you guys put it somewhere else in a separate class file, or
> maybe the "apt" class? My reason for not putting it in the
apt_class
> is that I have a separate class called "external" used for
> applications hosted elsewhere (skype, picasa, truecrypt) where I need
> to trigger an apt reload from.
The way Puppet handles scopes in this situation is not all that good,
IMO, and I wrote the darn stuff.
These defaults will only affect subclasses of this baseclass, or
classes included by it. Inasmuch as that''s what you want, then
it''s
as good a place as any, but just know that it might not get you the
behaviour you really want, and I''m not entirely confident I know of a
consistent way to get that behaviour.
Given the rate at which bugs are getting filed, it''s unlikely
I''ll
ever have time to fix this, either.
--
When one admits that nothing is certain one must, I think, also admit
that some things are much more nearly certain than others.
-- Bertrand Russell
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com