[Puppet Users] Different paths based on environment

Gonzalo Servat
Tue, 11 Oct 2011 21:14:08 -0000

Hi All,

In our environment, we have production and DR puppet clients that live on
different networks. Currently, we do things like "include
s_service::prod"
or "include s_service::dr", etc. Both of these subclasses would
inherit from
s_service where common things lie.

I am re-doing the Puppet config and trying to come up with a better way of
solving the multiple environment problem. Sometimes files need to be sourced
that depend on their environment. Currently we do "source =>
puppet:///${env}/file", which isn''t very nice.

I have created 2 new facter variables that identify whether the host is prod
or DR (based on the network they sit on), whereas before we would set the
zone statically in nodes.pp.

How do you guys solve the multiple environment problem? Is it best to use
templates and have if statements in them?

Thanks in advance.
Gonzalo