RFC: Environment configured by fact

Philip Walls
Thu, 07 Feb 2008 19:07:49 -0000

It would be handy to set the environment of a puppet client with the
$environment fact regardless of the version of said client.

Currently the puppetmaster prefers the ''environment''
configuration
option over the $environment fact, causing behavior to diverge between
<0.24 and <=0.24 clients. Since <0.24 clients don''t have a
default
value for that configuration option, the fact is authoritative.
However, the >=0.24 clients set a default for the configuration option
(''development''), making the fact moot.

The most straight forward solution would be to have the puppetmaster
always prefer the $environment fact.

Is there an argument for the configuration option taking precedence
over the fact? Is it worth the added complexity of only preferring the
fact if the configuration option hasn''t been set explicitly?

-P