On Monday, July 4, 2016 at 4:20:12 PM UTC-5, Gino Lisignoli wrote:
>
> NRPE Module: https://github.com/example42/puppet-nrpe
>
> If you have a look at the params.pp file, lines 67-74 you will see a block 
> of code that sets the value of a variable depending on the operating system 
> version. In my environment my operating system is ubuntu, and I would 
> expect the value of the $package variable to end up as: nagios-nrpe-server. 
> But what's happening is the $package variable ends up as 'nrpe' which 
> doesn't exist.
>
> The NRPE Module doesn't do anything with exported resources
>
> Anyway, running that code locally works fine. From a puppet master I get 
> the problem described. Which is very strange. I also tried disabling our 
> puppetdb server but still had the same problem.
>
> So yesterday I managed to resolve the problem, the resolution is to 
> disable puppet environment cache. 
>
> I know the situation to make the problem happen (turn environment caching 
> on), but I don't know why it is happening. When the environment cache is 
> turned on I can clear the the cache using the puppet admin api, and then 
> for one puppet run it will work fine, but (I'm assuming) after it is cached 
> it is getting confused with other nodes generating/using the same cache but 
> with different facts.
>
>

This problem has the hallmarks of a top-scope resource declaration -- i.e. 
one outside any class, node block, or defined type.  These are allowed, and 
they are sometimes reasonable in a site manifest, but they should never 
appear in manifests that are not guaranteed always to be evaluated, such as 
those in modules.  The problem is that top-scope declarations anywhere in 
the manifest set apply in principle to all nodes, so if they appear in 
manifests that Puppet evaluates only conditionally, such as via the module 
autoloader, then the catalog builder gets an inconsistent view of the 
global declarations.

The usual symptom of inappropriate top-level declaration is that resources 
seem to leak from some catalogs to others.  It is also possible for 
resource parameters to leak under certain circumstances.  The fact that 
clearing the cache resolves the problem temporarily is a strong indication 
that your problem lies in this area.

If you do have a problem with top-level declarations, then it is probably 
in one of your own modules, not in the Example42 module.  Probably it's in 
a module that uses the example42 module, but it could be one that uses it 
indirectly.


John

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4fca4db5-e217-4f3e-950e-fa17a4de3f34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to