"path" fact reordering

39 views
Skip to first unread message

Fabio Coatti

unread,
Apr 30, 2014, 5:17:36 AM4/30/14
to puppet...@googlegroups.com
Hi all,
I spotted a behaviour that I can't really understand (pupept 3.4.3).

Basicaly I have a setup with two masters balanced via apache reverse proxy. On clients every time the agent is run a facts.yaml is updated, to be used by mcollective.

running puppet agent with -t i can see that sometimes the "path" fact changes, more specifically the path order is changed, see here:

   osversion: Debian-7
-  path: "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+  path: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
   physicalprocessorcount: "2"

This happens more or less randomly (i.e. only with some runs, not always)

What puzzles me is that I can't find a reason for this change. afaik the configuration of path variable is not controlled by puppet. I'm suspecting some connection with the use of two masters, but I can't really figure out how this can matter...

Does someone can offer some hints, please? :)

Thanks.


--
Fabio

Pete Brown

unread,
Apr 30, 2014, 10:58:18 PM4/30/14
to puppet-users
Have you looked at how the shell variable is generated on each server?
My guess would be it is different on each one.

It may pay to manage it so it is the same on both masters.
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CADpTngVgsWe%2BFnt4JVWKA4hsK1a4TaC6WD%2BVyNg-uBBWAdd3Wg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

jcbollinger

unread,
May 1, 2014, 10:26:07 AM5/1/14
to puppet...@googlegroups.com

 
Fact values are mostly outside the agent's domain; it computes them via Facter early in the run, after syncing plugins (which may include custom facts) but before making a catalog request.  I see at least two reasonably likely explanations for the instability:

1. The path Puppet exports to Facter changes from time to time.
That would be unlikely if the agent is running in daemon mode, but it would be conceivable if you are launching one-off runs of the agent via an external scheduler such as cron.  Modifications to the scheduler's configuration -- by Puppet itself, for instance -- could alter the path it exports to the processes it launches.  Alternatively, if there are multiple schedulers launching Puppet, or one scheduler launching Puppet via multiple independent scheduler entries, then the different launch configurations might export different paths.

2. Some custom fact loaded into Facter mucks with Facter's environment (from which Facter draws the path value), and the value of the path fact depends on whether that other fact has already been evaluated.  Or, similarly, the different masters provide different versions of such a custom fact, so the path value depends on which version the client currently has.

Some of the variations on those possibilities point back to a difference between the two masters.  You might get a clue about such differences from Puppet's log, at the beginning of each run where it reports about syncing plugins.


John

Fabio Coatti

unread,
May 5, 2014, 3:34:27 AM5/5/14
to puppet...@googlegroups.com
Thanks for the hint! This behaviour comes from different env setup for different situations (say, command line, cron, etc). No functional differences but fact are correctly changed.
Thanks again for the hint. It was indeed obvious :)


--
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...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Fabio
Reply all
Reply to author
Forward
0 new messages