On Mon, Dec 10, 2012 at 2:58 AM, swair shah <[email protected]> wrote:

> Hi,
>
> Here is what I'm doing right now, Instead of compiling catalog everytime
> when a node sends a request to the master, check if the modules included
> for that node are changed or not, if they are changed then only compile the
> catalog.
>
> Q: How will I know which modules are included in a node? A: From puppetdb
> I can query the classes.
>
> Now I want a way to know if the classes have changed since the last
> request.
> Is there a way to know that?
>
>
Since classes are the output of compilation, you would need to compile the
catalog to find out if the classes changed, which kinda defeats what you
are trying to achieve.

To solve this you need to think about what the inputs are into the
compilation process: manifest files, facts, node classification, return
values from called functions. It would be possible to track change
information about most of those (e.g. for manifest files track a digest of
the file contents). Node classification and called functions are a little
trickier. We could of course re-classify the node assuming that the node
classification is cheap compared to a recompile. Functions present a
problem. A pure function isn't a problem, but a function that possible has
a different result given the same inputs causes problems (the most common
example of this is any random number generator) since we can't tell without
running the code if we would end up with the same output.


> Also if what I'm doing has some loophole then please let me know!
>
> thanks!
> Swair.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-dev/-/fQb7B54NtTAJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to