Re: [Puppet Users] Different paths based on environment

Nigel Kersten
Wed, 12 Oct 2011 15:25:43 -0000

On Tue, Oct 11, 2011 at 2:14 PM, Gonzalo Servat <gservat@gmail.com> wrote:

> 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.
>

Are you saying you''re sourcing files from outside the current
environment
for the client?

if you put your files into modules that differ per environment, then
something like:

puppet:///modules/mymodule/myfile

will resolve to $modulepath/mymodule/files/myfile separately for each
environment automatically.



>
> 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
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>



--
Nigel Kersten
Product Manager, Puppet Labs