On Tue, Dec 21, 2010 at 10:00:10AM -0800, Nigel Kersten wrote:
> I've just had a quick skim through and I can't seem to see any of our
> existing service providers doing this, but perhaps it's happening at a
> higher level above the actual service providers.

The existing providers are not using prefetch, so they execute the
status command for every service. As a result the exact same command can
be executed dozens of times like in launchd where '/bin/launchctl list'
is executed and parsed for each service. This is not really daramatic for
a simple status command but querying present/absent for hundreds of
packages might take some time (well it does on HP-UX...)

On Tue, Dec 21, 2010 at 10:00:10AM -0800, Nigel Kersten wrote:
> I think the last option is the right one, but yes, you've identified a bunch
> of problems whenever Puppet has to interact with resources that have their
> own dependencies.

While I agree that option three seems to be the right one it makes things
a lot more complicated. One option could be to use a class variable as
a flag. The prefetch method sets the variable to :clean to indicate that
the prefetched properyhashes are in sync. Then in every of these start
stop methods I can set the flag to :dirty to indicate that I changed the
state of one resource and that the propertyhashes of all the other
resources might be out of sync now. The status method which is run by
puppet to get the current :ensure property now has to decide:
If the flag is clean we can just query the prefetched propertyhash.
If its :dirty we have to run a seperate status command because we can
not rely on the value of the propertyhash.

But I dont really like that. Besides the user can also define something
like
service1 should be started -> puppet starts service1
service2 should be stopped -> puppet stops service2 which might
automatically stop service1 again so the endresult is not what
the user specified.

I mean that whould just be a stupid manifest but I want to demonstrate
that puppet cannot handle dependencies it's not aware of (obviously) so
why bother in the first place? Just hope that the user spends some
requires here and there. Do you think thats a valid demand?

-Stefan

Attachment: pgp99oHhDfx0d.pgp
Description: PGP signature

Reply via email to