[Novalug] Any puppet people out there?

Gopher gopher at 3wa.org
Thu Mar 22 09:25:15 EDT 2012


On 3/22/12 7:26 AM, Steve Bambling wrote:
> I think John nailed it, this is basically what we do for some of our
> classes.  I would also take a good look at the ruby erb templates, this
> gives you the ability to cascade setting in place of having a bunch of
> static files.
>
> For example:
>
> file { "/etc/sudoers":
>        mode    => 0440,
>        content => $template ? {
> 'default' => template("sudo/sudoers-default.erb"),
> 'qa'      => template("sudo/sudoers-qa.erb"),
> 'dev'     => template("sudo/sudoers-dev.erb"),
>
> Inside the sudoers-dev you can call the default template.
>
> <%= scope.function_template("sudo/sudoers-default.erb") %>
> %sudodev        ALL=(ALL)       ALL
>
>
> This way if a sysadmin leaves or you need to modify the default setting
> your not doing it across multiple files.
>
> v/r
>

My stuff isn't so simple - at least no the way I look at it.

I want to do the following:

- Define 'base' that will applied to all hosts with per-environment 
settings.
- Define exceptions based upon node name (i.e. 'dns.*')
- Define exceptions based upon specific node name (i.e. 'dns-test')

The issues I have is that I can only declare a given class once, 
regardless of the parameters passed to it (this galls me to no end, BTW 
- one reason I am not fond of Puppet at this time).

And I have yet to figure out how to do all this without being able to 
overload variables later in he configuration ('you can only define it 
once'.  ARG!)

And believe me, my explanation here is no where as complicated as my 
situation is in real life.  I've left out a lot of the gory details of 
waht I'm trying do to.  Needless to say hiera isn't helping and I think 
either I'm going to end up with a ton of duplicated configuration 
information all over the place or a lot of 'if host =X or hostname like 
'XXXX' ' type code in my modules.

thx.

-- 
gopher at 3wa.org
"Evil is, as humans do" - The Misfits


More information about the Novalug mailing list