Thanks for the assistance. I checked out Hiera and to be honest, that
is really way out of my league right now. When I get there, I will
definitely be looking into it, because I know I will get there soon,
unless you want to give me the 5 minutes selling pitch?
=)
I have been reading the style guide and the best practices pages and
came up with this model: (using CONFIG in caps to represent it as my
base module)
Since I have to manage 40 files all with different values, I just
created a subclass called
CONFIG::show1_prod_LA. In the show1_prod_LA.pp file, I created all my
specific key=value pairs, and then I included config.
in the CONFIG init.pp i have:
file { "/tmp/${app}_${site}_${env}.properites":
ensure => present,
content => template("mymodule/
template.properties.erb"),
So basically I am reusing the same class CONFIG but having each
subclass over write the values. This worked for the first subclass. I
tried creating a second subclass, called CONFIG:show1_prod_NY. This
subclass has the same keys, but obviously different values.
In my site.pp I have this:
node mydesktop{
include CONFIG::show1_prod_LA:
include CONFIG::show1_prod_NY
}
My problem is, only the first include "include
CONFIG::show1_prod_LA:" runs. Am I completely using puppet in a way
I'm not supposed to?
On Feb 11, 5:48 pm, Eric Shamow <
e...@puppetlabs.com> wrote:
> I would avoid this approach - global variables aren't a good idea.
>
> Hiera would be a better approach:
>
>
http://www.devco.net/archives/2011/06/05/hiera_a_pluggable_hierarchic...http://www.devco.net/archives/2011/06/06/puppet_backend_for_hiera.php
>
> -Eric
>
> --
>
> Eric Shamow
> Professional Serviceshttp://
puppetlabs.com/
> (c)
631.871.6441
>
>
>
>
>
>
>
> On Saturday, February 11, 2012 at 7:08 PM, krish wrote:
> > > My scenario is this: I have 4 environments, Dev, Test, QA, Prod. Each
> > > of these environments lives in 2 sites, LA and NY. I have 5
> > > applications that are site and env specific.
>
> > > I want to use puppet to template-ize the config files that is required
> > > for each env, per site, per app, so 40 files.
>
> > > The config file is basically key=value pairs. Here's a simple example
> > > of what each file may look like:
>
> > > site=LA
> > > env=Dev
> > > app=App1
> > > masterServer=host1
> > > clientServer1=host2
> > > clientServer2=host3
>
> > How about having these key value pairs in site.pp with a case environment
> > Then they become global to all modules.
>
> > --
> > Krish
> >
olindata.com (
http://olindata.com)
>
> > --
> > You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> > To post to this group, send email to
puppet...@googlegroups.com (mailto:
puppet...@googlegroups.com).
> > To unsubscribe from this group, send email to
puppet-users...@googlegroups.com (mailto:
puppet-users...@googlegroups.com).